Page 1 of 1

Metadata update confusion

Posted: 18 Oct 2024, 09:45
by Mibu
Hi

I frequently have to update metadata of my images. Once updated, I upload the file(s) via FTP (same filenames overwriting existing ones) to my Website, which is, when the problems start. Most of the time captions still show the old metadata.or in some cases (although I cannot confirm for sure, metadata within the new files seemed to be overwritten by X3? with the old values).

I have seen in another thread that the recommendation is to first delete all files, which are going to be replaced, but that is not so easily possible for me.

So my feature request would  be to have an "refresh metadata" button, which resolves this problem. While I couldn't find this, what is the recommended procedure to get the new captions properly displayed - preferrably by keeping the original image sort order?

Thank you
Michael

Re: Metadata update confusion

Posted: 18 Oct 2024, 10:16
by mjau-mjau
This is a can-o-worms, which I have dealt with earlier, and it would take ages to explain in detail. Can't you just upload an image with a new name? Problem solved.
  • Replacing an image with the same name, means you cold be stuck with old version in browser cache, CDN cache and X3 resize cache.
  • When you make changes to a page, it may save IPTC data into the page's JSON data file. This, because it's not safe to save IPTC data back INTO the image from PHP. Therefore, once you upload and make changes, and then upload a new image with the same file name, you might still be stuck with the DATA you saved/created earlier for the image. It's not necessarily logical that should be deleted, unless you first delete the image.
  • It would work fine to simply replace the image by upload, unless you have already saved some data and the JSON for the previously uploaded image was already created.
So my feature request would  be to have an "refresh metadata" button, which resolves this problem. While I couldn't find this, what is the recommended procedure to get the new captions properly displayed - preferrably by keeping the original image sort order?
I think this would be designed differently in X4. Currently, you would need to delete the image first or delete the stored caption in the folders page.json file. A "replaced" image won't replace the existing data for the image. What if someone writes a long caption for the image and wants to keep it after? It's not an optimal scenario in your case, but unfortunately your options are limited.

Re: Metadata update confusion

Posted: 18 Oct 2024, 14:14
by Mibu
I am not sure I fully understand the problem. Why isn't it possible to force-refresh / rebuild the JSON file with a button click: read again IPTC info from all images in this folder and update them in JSON?

What worked for me so far was: (1) delete JSON file (2) delete page cache and then re-upload the images. Unfortunately with this method I am losing the sort oder and page description etc info as well.

Assuming I would delete all files in a folder, then I press SAVE from the panel. When I then re-upload the images and click again SAVE in the panel: will that re-create the JSON file? If so will the gallery description be preserved, and only sort-order be lost?

Re: Metadata update confusion

Posted: 18 Oct 2024, 23:44
by mjau-mjau
Mibu wrote:I am not sure I fully understand the problem. Why isn't it possible to force-refresh / rebuild the JSON file with a button click: read again IPTC info from all images in this folder and update them in JSON?
I'm not saying it's "not possible". I'm saying that this is how X3 was built. For example, lets say after first upload, you have IPTC title "ABC". User then goes to page gallery and edits caption to "ABC DEF", and this of course gets stored in page.json. If they upload a new replacement image with the same name, does it mean they want the edited caption wiped clear? Definitely not necessarily. Even with a "force refresh" button, it doesn't necessarily mean the user wants to wipe all the captions they edited.

Anyway, this is not the point. I understand your issue, but because of how X3 is built, you simply can't EASILY edit IPTC data locally, and keep replacing images with new data, unless you first wipe the data. There is no button for this, maybe there could be, but there is not.
Mibu wrote:What worked for me so far was: (1) delete JSON file (2) delete page cache and then re-upload the images. Unfortunately with this method I am losing the sort oder and page description etc info as well.
It would be sufficient to just delete the JSON file. The page cache is would get refreshed automatically after you upload images from the panel anyway. However, if you delete the page.json file, you will lose the custom sort order, because that is also stored in page.json.

Actually, sort order is also stored inside the image as IPTC (X3 stores inside the image also), but as long as you are deleting page.json AND replacing the uploaded image, then you are also wiping the sort order.

As long as X3 doesn't (and can't) import everything into a database and lock the file system to DB, then these things are not easy.
Mibu wrote:Assuming I would delete all files in a folder, then I press SAVE from the panel. When I then re-upload the images and click again SAVE in the panel: will that re-create the JSON file? If so will the gallery description be preserved, and only sort-order be lost?
Deleting the images won't delete any data stored about the folder, for example gallery description. It will only delete everything stored about the images, including sort order and anything else specific to the images.

Re: Metadata update confusion

Posted: 19 Oct 2024, 04:29
by Mibu
Thanks a lot for this detailed explanation. I think I see now that the problem stems mainly from the fact that you can update IPTC from within X3 (which I never do) or externally and store it directly in the JPG - and that both need to be kept in sync somehow. A button, which updates all captions with the IPTC information stored in the images (and ignores potential updates done from the X3 panel) would still be very helpful (maybe with a respective warning), but I understand that in X4 you might even use a differnt approach.
Thank you for helping me better understand the way X3 is working!