diff options
author | mistic100 <mistic@piwigo.org> | 2011-04-08 10:51:54 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2011-04-08 10:51:54 +0000 |
commit | c9ec229a5af20e24c676c3af54a948ba718a876e (patch) | |
tree | fde70968914ba7bf9d0433b8aeb5ca4f511303ab /picture.php | |
parent | 758fe845f8dd663233a4082b7f758bea592be986 (diff) |
bug:1791 update webservices upload methods
git-svn-id: http://piwigo.org/svn/trunk@10160 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'picture.php')
-rw-r--r-- | picture.php | 56 |
1 files changed, 24 insertions, 32 deletions
diff --git a/picture.php b/picture.php index 1484814e2..c0493d8b0 100644 --- a/picture.php +++ b/picture.php @@ -903,7 +903,26 @@ $url = make_index_url( $infos['INFO_POSTED_DATE'] = '<a href="'.$url.'" rel="nofollow">'.$val.'</a>'; // size in pixels -if ($picture['current']['is_picture'] and isset($picture['current']['width']) ) +if ($picture['current']['is_picture'] AND $picture['current']['has_high']) +{ + if (!empty($picture['current']['high_width'])) + { + $infos['INFO_DIMENSIONS'] = $picture['current']['high_width'].'*'.$picture['current']['high_height']; + } + else if ($hi_size = @getimagesize($hi_url)) + { + pwg_query(' + UPDATE ' . IMAGES_TABLE . ' + SET + high_width = \'' . $hi_size[0].'\', + high_height = \''.$hi_size[1] .'\' + WHERE id = ' . $picture['current']['id'] . '; + '); + + $infos['INFO_DIMENSIONS'] = $hi_size[0].'*'.$hi_size[1]; + } +} +else if ($picture['current']['is_picture'] and isset($picture['current']['width']) ) { if ($picture['current']['scaled_width'] !== $picture['current']['width'] ) { @@ -919,43 +938,16 @@ if ($picture['current']['is_picture'] and isset($picture['current']['width']) ) } } -// hd size in pixels -if ($picture['current']['is_picture'] AND $picture['current']['has_high']) -{ - if (!empty($picture['current']['high_width'])) - { - $infos['INFO_DIMENSIONS'] = $picture['current']['high_width'].'*'.$picture['current']['high_height']; - } - else - { - $hi_size = @getimagesize($hi_url); - if ($hi_size !== false) - { - pwg_query(' - UPDATE ' . IMAGES_TABLE . ' - SET - high_width = \'' . $hi_size[0].'\', - high_height = \''.$hi_size[1] .'\' - WHERE id = ' . $picture['current']['id'] . '; - '); - - $infos['INFO_DIMENSIONS'] = $hi_size[0].'*'.$hi_size[1]; - } - } -} - // filesize -if (!empty($picture['current']['filesize'])) +if ($picture['current']['has_high'] and !empty($picture['current']['high_filesize'])) { $infos['INFO_FILESIZE'] = - sprintf(l10n('%d Kb'), $picture['current']['filesize']); + sprintf(l10n('%d Kb'), $picture['current']['high_filesize']); } - -// hd filesize -if ($picture['current']['has_high'] and !empty($picture['current']['high_filesize'])) +else if (!empty($picture['current']['filesize'])) { $infos['INFO_FILESIZE'] = - sprintf(l10n('%d Kb'), $picture['current']['high_filesize']); + sprintf(l10n('%d Kb'), $picture['current']['filesize']); } // number of visits |