From d1389ee8eb482e8517bfe01d02734cf2971fe3e4 Mon Sep 17 00:00:00 2001 From: z0rglub Date: Mon, 16 Aug 2004 21:42:54 +0000 Subject: bug correction : in case of metadata (image dimension, filesize) not registered into database, they couldn't be calculated git-svn-id: http://piwigo.org/svn/trunk@484 68402e56-0260-453c-a942-63ccdbb3a9ee --- picture.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'picture.php') diff --git a/picture.php b/picture.php index 6ea73e4b9..d08928679 100644 --- a/picture.php +++ b/picture.php @@ -363,9 +363,9 @@ else if ( $page['cat'] == 'search' ) } // calculation of width and height -if ( empty($picture['current']['width'])) +if (empty($picture['current']['width'])) { - $taille_image = @getimagesize( $lien_image ); + $taille_image = @getimagesize($picture['current']['src']); $original_width = $taille_image[0]; $original_height = $taille_image[1]; } @@ -528,18 +528,25 @@ $template->assign_block_vars('info_line', array( 'VALUE'=>$picture['current']['file'] )); // filesize -if ( empty($picture['current']['filesize'])) +if (empty($picture['current']['filesize'])) { - $poids = floor ( filesize( $picture['current']['url'] ) / 1024 ); + if (!$picture[$i]['is_picture']) + { + $filesize = floor(filesize($picture['current']['download'])/1024); + } + else + { + $filesize = floor(filesize($picture['current']['src'])/1024); + } } else { - $poids = $picture['current']['filesize']; + $filesize = $picture['current']['filesize']; } $template->assign_block_vars('info_line', array( 'INFO'=>$lang['filesize'], - 'VALUE'=>$poids.' KB' + 'VALUE'=>$filesize.' KB' )); // keywords if ( !empty($picture['current']['keywords'])) -- cgit v1.2.3