Changeset 484


Ignore:
Timestamp:
Aug 16, 2004, 11:42:54 PM (20 years ago)
Author:
z0rglub
Message:

bug correction : in case of metadata (image dimension, filesize) not
registered into database, they couldn't be calculated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r465 r484  
    364364
    365365// calculation of width and height
    366 if ( empty($picture['current']['width']))
    367 {
    368   $taille_image = @getimagesize( $lien_image );
     366if (empty($picture['current']['width']))
     367{
     368  $taille_image = @getimagesize($picture['current']['src']);
    369369  $original_width = $taille_image[0];
    370370  $original_height = $taille_image[1];
     
    529529          ));
    530530// filesize
    531 if ( empty($picture['current']['filesize']))
    532 {
    533   $poids = floor ( filesize( $picture['current']['url'] ) / 1024 );
     531if (empty($picture['current']['filesize']))
     532{
     533  if (!$picture[$i]['is_picture'])
     534  {
     535    $filesize = floor(filesize($picture['current']['download'])/1024);
     536  }
     537  else
     538  {
     539    $filesize = floor(filesize($picture['current']['src'])/1024);
     540  }
    534541}
    535542else
    536543{
    537   $poids = $picture['current']['filesize'];
     544  $filesize = $picture['current']['filesize'];
    538545}
    539546
    540547$template->assign_block_vars('info_line', array(
    541548          'INFO'=>$lang['filesize'],
    542           'VALUE'=>$poids.' KB'
     549          'VALUE'=>$filesize.' KB'
    543550          ));
    544551// keywords
Note: See TracChangeset for help on using the changeset viewer.