Changeset 10157


Ignore:
Timestamp:
04/08/11 11:09:13 (9 years ago)
Author:
mistic100
Message:

bug:1791 display hd dimensions instead of websize dimensions

Location:
trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_upload.inc.php

    r9952 r10157  
    348348      $update['has_high'] = 'true'; 
    349349      $update['high_filesize'] = $high_infos['filesize']; 
     350      $update['high_width'] = $high_infos['width']; 
     351      $update['high_height'] = $high_infos['height']; 
    350352    } 
    351353    else 
     
    353355      $update['has_high'] = 'false'; 
    354356      $update['high_filesize'] = null; 
     357      $update['high_width'] = null; 
     358      $update['high_height'] = null; 
    355359    } 
    356360 
     
    388392      $insert['has_high'] = 'true'; 
    389393      $insert['high_filesize'] = $high_infos['filesize']; 
     394      $insert['high_width'] = $high_infos['width']; 
     395      $insert['high_height'] = $high_infos['height']; 
    390396    } 
    391397 
  • trunk/admin/site_reader_local.php

    r8728 r10157  
    155155  global $conf; 
    156156 
    157   $update_fields = array('filesize', 'width', 'height', 'high_filesize'); 
     157  $update_fields = array('filesize', 'width', 'height', 'high_filesize', 'high_width', 'high_height'); 
    158158 
    159159  if ($conf['use_exif']) 
     
    200200  { 
    201201    $high_file = dirname($file).'/pwg_high/'.basename($file); 
    202  
    203202    $data['high_filesize'] = floor(filesize($high_file)/1024); 
     203     
     204    if ($high_size = @getimagesize($high_file)) 
     205    { 
     206      $data['high_width'] = $high_size[0]; 
     207      $data['high_height'] = $high_size[1]; 
     208    } 
    204209  } 
    205210 
  • trunk/admin/site_reader_remote.php

    r8728 r10157  
    4444    ); 
    4545  $this->metadata_attributes = array( 
    46     'filesize', 'width', 'height', 'high_filesize' 
     46    'filesize', 'width', 'height', 'high_filesize', 'high_width', 'high_height', 
    4747    ); 
    4848 
  • trunk/install/piwigo_structure-mysql.sql

    r9086 r10157  
    193193  `storage_category_id` smallint(5) unsigned default NULL, 
    194194  `high_filesize` mediumint(9) unsigned default NULL, 
     195  `high_width` smallint(9) unsigned default NULL, 
     196  `high_height` smallint(9) unsigned default NULL, 
    195197  `level` tinyint unsigned NOT NULL default '0', 
    196198  `md5sum` char(32) default NULL, 
  • trunk/install/piwigo_structure-pdo-sqlite.sql

    r8802 r10157  
    189189  "storage_category_id" INTEGER, 
    190190  "high_filesize" INTEGER, 
     191  "high_width" INTEGER, 
     192  "high_height" INTEGER, 
    191193  "level" INTEGER default 0 NOT NULL, 
    192194  "md5sum" CHAR(32), 
  • trunk/install/piwigo_structure-pgsql.sql

    r8802 r10157  
    233233  "storage_category_id" INTEGER, 
    234234  "high_filesize" INTEGER, 
     235  "high_width" INTEGER, 
     236  "high_height" INTEGER, 
    235237  "level" INTEGER default 0 NOT NULL, 
    236238  "md5sum" CHAR(32), 
  • trunk/install/piwigo_structure-sqlite.sql

    r8802 r10157  
    189189  "storage_category_id" INTEGER, 
    190190  "high_filesize" INTEGER, 
     191  "high_width" INTEGER, 
     192  "high_height" INTEGER, 
    191193  "level" INTEGER default 0 NOT NULL, 
    192194  "md5sum" CHAR(32), 
  • trunk/picture.php

    r10122 r10157  
    920920} 
    921921 
     922// hd size in pixels 
     923if ($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 
    922947// filesize 
    923948if (!empty($picture['current']['filesize'])) 
     
    925950  $infos['INFO_FILESIZE'] = 
    926951    sprintf(l10n('%d Kb'), $picture['current']['filesize']); 
     952} 
     953 
     954// hd filesize 
     955if ($picture['current']['has_high'] and !empty($picture['current']['high_filesize'])) 
     956{ 
     957  $infos['INFO_FILESIZE'] = 
     958    sprintf(l10n('%d Kb'), $picture['current']['high_filesize']); 
    927959} 
    928960 
  • trunk/tools/create_listing_file.php

    r10000 r10157  
    739739        $high_file = $file_dir.'/'.$conf['high'].'/'.$file_base; 
    740740        $element['high_filesize'] = floor(filesize($high_file) / 1024); 
     741         
     742        if ($high_size = @getimagesize($high_file)) 
     743        { 
     744          $element['high_width'] = $high_size[0]; 
     745          $element['high_height'] = $high_size[1]; 
     746        } 
    741747      } 
    742748       
Note: See TracChangeset for help on using the changeset viewer.