From 438e1252bdeec05370720b2ed62a21b209e2f0fc Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 30 Mar 2011 21:25:32 +0000 Subject: bug fixed: for metadata synchronization, use the same behavior in pwg.images.addSimple as in pwg.images.add, ie the metadata mapping is prioritary compared to values given to the web API methods (author, description, title...) git-svn-id: http://piwigo.org/svn/trunk@9944 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/ws_functions.inc.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php index 849ff949e..5807a4cc1 100644 --- a/include/ws_functions.inc.php +++ b/include/ws_functions.inc.php @@ -1450,6 +1450,19 @@ SELECT id, name, permalink $url_params['category'] = $category; } + // update metadata from the uploaded file (exif/iptc), even if the sync + // was already performed by add_uploaded_file(). + $query = ' +SELECT + path + FROM '.IMAGES_TABLE.' + WHERE id = '.$image_id.' +;'; + list($file_path) = pwg_db_fetch_row(pwg_query($query)); + + require_once(PHPWG_ROOT_PATH.'admin/include/functions_metadata.php'); + update_metadata(array($image_id=>$file_path)); + return array( 'image_id' => $image_id, 'url' => make_picture_url($url_params), -- cgit v1.2.3