Changeset 28256 for extensions/Tags2File/db_export_image_metadata_class.php
- Timestamp:
- Apr 24, 2014, 11:31:29 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Tags2File/db_export_image_metadata_class.php
r4620 r28256 88 88 $this->nbfiles = 0; 89 89 90 while ($row = mysql_fetch_row($datas)) // row to avoid conflict with name90 while ($row = pwg_db_fetch_row($datas)) // row to avoid conflict with name 91 91 { 92 92 $image_path = $row[5]; 93 $has_high = $row[6] === 'true';94 93 95 94 if ($this->isTest || file_exists($image_path)) … … 98 97 { 99 98 $cmd = $this->convert_row_to_file_exiftool($row); 100 $this->write_exifCmd($cmd, $image_path, $ has_high, $fp_exiftool);99 $this->write_exifCmd($cmd, $image_path, $fp_exiftool); 101 100 } 102 101 if ($this->use_exiv2) 103 102 { 104 103 $cmd = $this->convert_row_to_file_exiv2($row); 105 $this->write_exifCmd($cmd, $image_path, $ has_high, $fp_exiv2);104 $this->write_exifCmd($cmd, $image_path, $fp_exiv2); 106 105 } 107 106 } … … 169 168 $tags = $this->cutString($this->decode_html_string_to_unicode($row[4], true), 64); 170 169 $image_path = $row[5]; 171 $has_high = $row[6] === 'true';172 170 173 171 $exiv2Cmd = $this->exiv2DefaultCmd; … … 228 226 } 229 227 230 private function write_exifCmd($exifCmd, $image_path, $ has_high, $fp)228 private function write_exifCmd($exifCmd, $image_path, $fp) 231 229 { 232 230 $exifCmdN = $exifCmd ." "; … … 235 233 if ($writeOK) $this->nbfiles++; 236 234 237 if ($has_high)238 {239 $imageHigh = dirname($image_path) . "/pwg_high/" . basename($image_path);240 if (file_exists($imageHigh))241 { $this->write_exifCmd($exifCmd, $imageHigh, false, $fp); }242 }243 235 } 244 236 … … 312 304 $query_path = $this->isTest ? 'img.file' : 'img.path'; 313 305 $query_restriction = $this->isTest ? 'AND (img.id = '.$this->test_img_id.'))' : ')'; 306 314 307 // get direct properties and tags, even if no tags, with either name, comment or tags not null 315 308 // restritive query with image.ID for tests with copied images with file instead of path 316 $img_query = 'SELECT img.name, img.comment, img.author, img.date_creation, GROUP_CONCAT(tags.name), '.$query_path.', has_high 317 FROM '.IMAGES_TABLE.' AS img 318 LEFT OUTER JOIN '.IMAGE_TAG_TABLE.' AS img_tag ON img_tag.image_id = img.id 319 LEFT OUTER JOIN '.TAGS_TABLE.' AS tags ON tags.id = img_tag.tag_id 320 WHERE ( ( LENGTH(img.name) > 0 OR LENGTH(img.comment) > 0 OR LENGTH(img.author) > 0 OR LENGTH(tags.name) > 0 ) '.$query_restriction.' 321 GROUP BY img.id, img.name, img.comment, img.author, '.$query_path.', has_high 322 ORDER BY img.id ASC; '; 309 $img_query = ' 310 SELECT 311 img.name, 312 img.comment, 313 img.author, 314 img.date_creation, 315 GROUP_CONCAT(tags.name), 316 '.$query_path.' 317 FROM '.IMAGES_TABLE.' AS img 318 LEFT OUTER JOIN '.IMAGE_TAG_TABLE.' AS img_tag ON img_tag.image_id = img.id 319 LEFT OUTER JOIN '.TAGS_TABLE.' AS tags ON tags.id = img_tag.tag_id 320 WHERE ( ( LENGTH(img.name) > 0 OR LENGTH(img.comment) > 0 OR LENGTH(img.author) > 0 OR LENGTH(tags.name) > 0 ) '.$query_restriction.' 321 GROUP BY img.id, img.name, img.comment, img.author, '.$query_path.' 322 ORDER BY img.id ASC 323 ;'; 323 324 324 325 return pwg_query($img_query);
Note: See TracChangeset
for help on using the changeset viewer.