Changeset 10160


Ignore:
Timestamp:
Apr 8, 2011, 12:51:54 PM (13 years ago)
Author:
mistic100
Message:

bug:1791 update webservices upload methods

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/ws_functions.inc.php

    r10061 r10160  
    12471247  {
    12481248    $update['high_filesize'] = $infos['filesize'];
     1249    $update['high_width'] = $infos['width'];
     1250    $update['high_height'] = $infos['height'];
    12491251    $update['has_high'] = 'true';
    12501252  }
     
    13751377    $insert['has_high'] = 'true';
    13761378    $insert['high_filesize'] = $high_infos['filesize'];
     1379    $insert['high_width'] = $high_infos['width'];
     1380    $insert['high_height'] = $high_infos['height'];
    13771381  }
    13781382
  • trunk/picture.php

    r10157 r10160  
    904904
    905905// size in pixels
    906 if ($picture['current']['is_picture'] and isset($picture['current']['width']) )
     906if ($picture['current']['is_picture'] AND $picture['current']['has_high'])
     907{
     908  if (!empty($picture['current']['high_width']))
     909  {
     910    $infos['INFO_DIMENSIONS'] = $picture['current']['high_width'].'*'.$picture['current']['high_height'];
     911  }
     912  else if ($hi_size = @getimagesize($hi_url))
     913  {
     914    pwg_query('
     915      UPDATE ' . IMAGES_TABLE . '
     916      SET
     917        high_width = \'' . $hi_size[0].'\',
     918        high_height = \''.$hi_size[1] .'\'
     919      WHERE id = ' . $picture['current']['id'] . ';
     920    ');
     921   
     922    $infos['INFO_DIMENSIONS'] = $hi_size[0].'*'.$hi_size[1];
     923  }
     924}
     925else if ($picture['current']['is_picture'] and isset($picture['current']['width']) )
    907926{
    908927  if ($picture['current']['scaled_width'] !== $picture['current']['width'] )
     
    920939}
    921940
    922 // hd size in pixels
    923 if ($picture['current']['is_picture'] AND $picture['current']['has_high'])
    924 {
    925   if (!empty($picture['current']['high_width']))
    926   {
    927     $infos['INFO_DIMENSIONS'] = $picture['current']['high_width'].'*'.$picture['current']['high_height'];
    928   }
    929   else
    930   {
    931     $hi_size = @getimagesize($hi_url);
    932     if ($hi_size !== false)
    933     {
    934       pwg_query('
    935         UPDATE ' . IMAGES_TABLE . '
    936         SET
    937           high_width = \'' . $hi_size[0].'\',
    938           high_height = \''.$hi_size[1] .'\'
    939         WHERE id = ' . $picture['current']['id'] . ';
    940       ');
    941      
    942       $infos['INFO_DIMENSIONS'] = $hi_size[0].'*'.$hi_size[1];
    943     }
    944   }
    945 }
    946 
    947941// filesize
    948 if (!empty($picture['current']['filesize']))
     942if ($picture['current']['has_high'] and !empty($picture['current']['high_filesize']))
     943{
     944  $infos['INFO_FILESIZE'] =
     945    sprintf(l10n('%d Kb'), $picture['current']['high_filesize']);
     946}
     947else if (!empty($picture['current']['filesize']))
    949948{
    950949  $infos['INFO_FILESIZE'] =
    951950    sprintf(l10n('%d Kb'), $picture['current']['filesize']);
    952 }
    953 
    954 // hd filesize
    955 if ($picture['current']['has_high'] and !empty($picture['current']['high_filesize']))
    956 {
    957   $infos['INFO_FILESIZE'] =
    958     sprintf(l10n('%d Kb'), $picture['current']['high_filesize']);
    959951}
    960952
Note: See TracChangeset for help on using the changeset viewer.