Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Exif extraction overwrites previous captions
https://www.tinywebgallery.com/forum/viewtopic.php?f=5&t=3391
Page 1 of 1

Author:  lmihaly [ 18. Aug 2012, 22:51 ]
Post subject:  Exif extraction overwrites previous captions

Michael,

If in the config file "$exif_field_for_caption" is set to some valid value (e.g. DateTime) and one executes an "Extract IPTC Data" command from the administration panel, all of the earlier captions will be deleted and overwritten by the exif data. I think this is wrong. It also slows down the exif processing.

It is easy to fix the problem. In readxml.inc.php there is an " if (!isset($retValue)) { } " statement - this protects the existing caption from being overwritten. However, the "}" has to be moved FORWARD, after the exif data processing, and right before saving. BTW, this way the whole exif processing will be faster, since lots of write operations will be eliminated.

Cheers,

Laszlo

Author:  TinyWebGallery [ 19. Aug 2012, 21:10 ]
Post subject:  Re: Exif extraction overwrites previous captions

This makes sense. I moved the readexif into the
if (!isset($retValue)) {
so that the exif is only read if nothing is set yet.

This will be available in 1.8.9

Best, Michael

Author:  lmihaly [ 21. Aug 2012, 19:23 ]
Post subject:  Re: Exif extraction overwrites previous captions

Michael,

Here is another exif-related issue:

I am converting an existing album to TWG, and I have thousands of photos in about a 100 folders. Since I have my own server, I am not using the uploader, I simply copy the photos into a file under the "pictures" directory. Extracting exif data for a large number of new photos is very slow (as you mentioned in the FAQ).

Here is the reason: when one hits "Extract IPTC" in the admin panel, the program scans for all photos and reads the xml file for EVERY single photo. If it finds a "new" photo, it writes the (modified) xml file, and then it reads it again for the next photo.

Instead, it should read the xml file only once for every directory, and write it only once (if necessary) when the scanning of all photos in that directory is finished. What do you think? Is it possible to fix this?

Best.

Laszlo

Author:  TinyWebGallery [ 21. Aug 2012, 21:36 ]
Post subject:  Re: Exif extraction overwrites previous captions

The functions for single usage are used here.

Optimizing would mean to rewrite everything.

Best, Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/