From b0478ef330b8f729554aec55baa81d9e3d02a063 Mon Sep 17 00:00:00 2001 From: plegall Date: Fri, 9 Mar 2007 16:28:49 +0000 Subject: New: #images.high_filesize was added so that we can sum the filesizes in the filtered history. #images.high_filesize is filled during metadata synchronization. Bug fixed: in getAttribute XML function, when asking "filesize", it was returning high_filesize. The regex was too simple. git-svn-id: http://piwigo.org/svn/trunk@1883 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions_metadata.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'admin/include/functions_metadata.php') diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php index f26184ce7..053c34afe 100644 --- a/admin/include/functions_metadata.php +++ b/admin/include/functions_metadata.php @@ -105,6 +105,28 @@ function update_metadata($files) $datas = array(); $tags_of = array(); + $has_high_images = array(); + + $image_ids = array(); + foreach ($files as $id => $file) + { + array_push($image_ids, $id); + } + + $query = ' +SELECT id + FROM '.IMAGES_TABLE.' + WHERE has_high = \'true\' + AND id IN ( +'.wordwrap(implode(', ', $image_ids), 80, "\n").' +) +;'; + + $result = pwg_query($query); + while ($row = mysql_fetch_array($result)) + { + array_push($has_high_images, $row['id']); + } foreach ($files as $id => $file) { @@ -117,6 +139,13 @@ function update_metadata($files) $data['width'] = $image_size[0]; $data['height'] = $image_size[1]; } + + if (in_array($id, $has_high_images)) + { + $high_file = dirname($file).'/pwg_high/'.basename($file); + + $data['high_filesize'] = floor(filesize($high_file)/1024); + } if ($conf['use_exif']) { @@ -161,6 +190,7 @@ function update_metadata($files) 'filesize', 'width', 'height', + 'high_filesize', 'date_metadata_update' ); -- cgit v1.2.3