Search…

X3 Photo Gallery Support Forums

Search…
 
Vizzygo
Topic Author
Posts: 3
Joined: 07 Sep 2018, 12:41

IPTC data persistance after uploading twice and deleting the first file

17 Jan 2022, 12:11

Here is my scenario to reproduce
1) upload of a Jpeg with Title and Description IPTC metadata
2) change the IPTC Title with a picture editor the same raw editor (lightroom, DXO, etc)
3) upload the new edited file in your X3 panel, the file is added with the number  "1" after the filename because it already exists. So now there are 2 files :
 
  - Picture_name.jpg  (PIX1)
 and
  - Picture_name1.jpg (PIX2)

4) In the gallery, no problem,  there are now 2 pictures that are of course the same but with different IPTC data
5) I delete the PIX1  and I rename the PIX2 with the PIX1 name so now I only get Picture_name.jpg in my gallery file list.
6)  and now I check and X3 still displays the IPTC from the PIX1 instead of the PIX2.  It seems X3 saved in memory the IPTC data and could restored it by matching the filename from the first file, that has been deleted but not the metadata !!!
7) and now, It's magical,  If I rename PIX2 with anything than the first picture name, included PIX2 filename, I can get the right IPTC data of PIX2

So strange to find and verify this bug, at first I thought about an error during the raw process or upload with X3
For sure I tried to clean cache for Image and Page but nothing more
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13286
Joined: 30 Sep 2006, 03:37

Re: IPTC data persistance after uploading twice and deleting the first file

17 Jan 2022, 22:59

Your observations are correct, and there are some issues in X3 that I will need to address in the future. Explanation:

As you are aware, X3 supports IPTC title/description from images, and the values will populate X3's title and description fields for the image (which by default are empty). When you SAVE page settings in X3, all titles and descriptions will be stored in the page.json, regardless of where they originated from. Data from page.json will be prioritized over IPTC data, because it may contain changes that the user made from the control panel. Because of this, you may experience circumstances where you add new files and may get stuck with the data that was stored in page.json for that filename previously, instead of the updated IPTC data for that file name.

This is something I will be considering, but in the meantime, your options:
  • Before uploading a replacement image, always first delete the image you are planning to replace from the panel. When you delete the image first, you will also delete the title/description references for the image, making room for updated IPTC data from the image you intend to upload.
  • Optionally, always increment the filename to avoid issues like this. For example, if you want to replace "tree.jpg", give the new image version a new name, for example "tree2.jpg". It can be renamed before or after upload. This is also a good idea in general, because you avoid browser and proxy caching of images that might have changed visually.
 
Vizzygo
Topic Author
Posts: 3
Joined: 07 Sep 2018, 12:41

Re: IPTC data persistance after uploading twice and deleting the first file

28 Jan 2022, 08:28

Ok It's clear now Karl ! Thank you ! so If I understood well, the patch would be an erase of the information of the image when we delete it. It's very interesting because that means that you could also use this page.json management for a multilingual use just by passing the language code in parameter to display the right page and avoid to  multiply instances of X3 in different folders. ;-)

Other subject regarding IPTC (may I create a dedicated topic ? ), in the last update of DXO photolab, they changed the metadata rules to keep only XMP format so now X3 is blind with XMP files and can not retrieve title, description, etc. Is there a future update that could reflect this case ? Nowadays, IPTC seems to be obsolete.
And last thing, is there a way to display copyright metadata fields <xmpRights:UsageTerms> and  use rights <dc:rights>  in a conf file or better by adding more tags in the metadata caption tags list ? This could be nice to display copyrights info in the footer.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13286
Joined: 30 Sep 2006, 03:37

Re: IPTC data persistance after uploading twice and deleting the first file

28 Jan 2022, 23:56

Vizzygo wrote:It's very interesting because that means that you could also use this page.json management for a multilingual use just by passing the language code in parameter to display the right page and avoid to  multiply instances of X3 in different folders. ;-)
:) page.json is used to store anything from the folder, and of course it would also be where we stored languages if such a thing existed. However, X3 pages still get pre-rendered into cache based on data from page.json, and page.json isn't actually loaded on a per-visit basis, so this is slightly off-topic for the time being.
Vizzygo wrote:Other subject regarding IPTC (may I create a dedicated topic ? ), in the last update of DXO photolab, they changed the metadata rules to keep only XMP format so now X3 is blind with XMP files and can not retrieve title, description, etc. Is there a future update that could reflect this case ? Nowadays, IPTC seems to be obsolete.
Well, that's interesting of course, as I'm not entirely updated on the trends of IPTC vs XMP. Was there any explanation for that move? (just curious). PHP supports iptcparse() as a native function, while XMP extraction requires loading the file into PHP in chunks and attempting to extract XMP tags from the binary data (see post). Not a preferable approach.
Vizzygo wrote:And last thing, is there a way to display copyright metadata fields <xmpRights:UsageTerms> and  use rights <dc:rights>  in a conf file or better by adding more tags in the metadata caption tags list ? This could be nice to display copyrights info in the footer.
You are referring to display more meta info from image in the X3 popup? I am not quite sure what you are mean "use in conf file" or "in the footer". Of course it would be possible for X3 to display additional EXIF and IPTC fields, although this requires more config options. If you are asking to display additional fields from XMP, then the above would additionally need to be resolved first.

:clap: :punch:
 
Vizzygo
Topic Author
Posts: 3
Joined: 07 Sep 2018, 12:41

Re: IPTC data persistance after uploading twice and deleting the first file

30 Jan 2022, 13:42

Regarding IPTC vs XMP here is some info here https://www.carlseibert.com/xmp-iptciim-or-exif-which-is-preferred/
You are referring to display more meta info from image in the X3 popup? I am not quite sure what you are mean "use in conf file" or "in the footer"
It would be great to personalize the caption items lists and add tags  just by editing a configuration file with for example inside :
Code
$iptcHeaderArray = array
(
    '2#005'=>'DocumentTitle',
    '2#010'=>'Urgency',
    '2#015'=>'Category',
    '2#020'=>'Subcategories',
    '2#040'=>'SpecialInstructions',
    '2#055'=>'CreationDate',
    '2#080'=>'AuthorByline',
    '2#085'=>'AuthorTitle',
    '2#090'=>'City',
    '2#095'=>'State',
    '2#101'=>'Country',
    '2#103'=>'OTR',
    '2#105'=>'Headline',
    '2#110'=>'Source',
    '2#115'=>'PhotoSource',
    '2#116'=>'Copyright',
    '2#120'=>'Caption',
    '2#122'=>'CaptionWriter'
);
And about  recurring copyright footer, It would be great to have a specific and customizable field with default text or information from the IPTC metadata if it exists in the picture case of multiple copyright owners (newpaper, architecture, etc).
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13286
Joined: 30 Sep 2006, 03:37

Re: IPTC data persistance after uploading twice and deleting the first file

30 Jan 2022, 22:24

Vizzygo wrote:It would be great to personalize the caption items lists and add tags  just by editing a configuration file with for example inside :
Code
$iptcHeaderArray = array
(
    '2#005'=>'DocumentTitle',
    '2#010'=>'Urgency',
    '2#015'=>'Category',
    '2#020'=>'Subcategories',
    '2#040'=>'SpecialInstructions',
    '2#055'=>'CreationDate',
    '2#080'=>'AuthorByline',
    '2#085'=>'AuthorTitle',
    '2#090'=>'City',
    '2#095'=>'State',
    '2#101'=>'Country',
    '2#103'=>'OTR',
    '2#105'=>'Headline',
    '2#110'=>'Source',
    '2#115'=>'PhotoSource',
    '2#116'=>'Copyright',
    '2#120'=>'Caption',
    '2#122'=>'CaptionWriter'
);
Indeed. Also in the future, I would probably move towards a "caption template", something like {%if(meta.headling)%}<strong>{{meta.headline}}</strong><br>{% endif %}. There is no other useful way I can pre-design a caption-layout of loads of image meta items that I don't know if exists or how long they are. For example, if you define the above, how would I stack it into the layout? Just new lines? What about titles for each property? And then of course, if we are to also use XMP (we would need both), I dread the idea of how that would be configured alongside IPTC in any functional way :thinking: Anyway :smile:
Vizzygo wrote:And about  recurring copyright footer, It would be great to have a specific and customizable field with default text or information from the IPTC metadata if it exists in the picture case of multiple copyright owners (newpaper, architecture, etc).
Sorry, but I don't follow ... What is "recurring copyright footer"? You mean you want an additional input field for image captions where you can add anything you want? That's kinda what the generic "description" field in X3 is already for.