When I click on the refresh metadata icon on album from zenphoto/zp-core/admin-edit.php it appears to try and refresh the metadata from all of the images in the album. I can see this because the id value in the URL line is steadily rising from 3112 (the smallest ID in zp_images, up to 4820 at the moment). Having a quick look at the code it looks like what should happen is that the mtime value for the images in the album are set to zero and then any image where the mtime doesn't equal that of the file is refreshed. Running in mySQL:
`SELECT COUNT(*) FROM zp_images WHERE mtime=0;`
gives 52. There are 53 images/videos in the album.
Any ideas what is going wrong? I did have a plugin that filtered on image_refresh but I have removed that for the time being.
I am running zenphoto version 1.2.9 [5088]
Many thanks
Comments
To do so, first it sets mdata to zero for all the images within the album. Then it runs the standard garbage collect function. That function will examine all the images and for those whose mdata does not match the file time it will perform the refresh. Typically this will be just those images within the album.
No data will be lost (which would not have otherwise been lost) as any image "loaded" which has an mtime mismatch will have its data refreshed.
I think I understand now. Is there a particular design reason for this approach, rather than specifically processing only the selected album? I will look through the code to see about making this affect only the selected album, but if there's a known particular reason this approach wasn't taken, it might be good for me to be aware of that in advance...
On the other hand, it can be changed fairly easily to process just the images with `mtime` set to zero, so we will make that change. In effect this does what you want.
So that seems to suggest that for some reason the mtime is not matching the filemtime even after a full gallery metadata refresh. But looking at the mtime in the database of an example file and an ls -l they are the same. Hmmmm.
`$restartwhere = ' WHERE id>'.$restart.' AND mtime=0';`
Many thanks