Trying to set Dates in Metadata => Writeback does not work

Started by werner-k, June 08, 2019, 01:08:11 PM

Previous topic - Next topic

werner-k

I have some old jpgs where IMatch shows only the following dates after scanning:
- Created Date
- Date Subject Created

I would like to set the content of one of these tags (e.g. Created Date) to the exif-data of the jpgs.
So I used the presets to set the following tags:
- XMP::exif\DateTimeDigitized => {File.MD.XMP::xmp\CreateDate\CreateDate\0}
- XMP::exif\DateTimeOriginal => {File.MD.XMP::xmp\CreateDate\CreateDate\0}

After the update, the Metadata browser correctly shows the tags as updated and the pencil shows that data needs to be written back

But when I click on the pencil to write the data back... and after the "Updating" message disappears...
- all dates, including "Created Date" and "Date Subject Created" are set to the current date and time instead
- the XMP:exif tags are not set at all


What am I doing wrong here?

Mario

The two tags tags are automatically filled during the import, when IMatch maps from EXIF data in your file to XMP.

XMP::xmp\CreateDate\CreateDate
XMP::photoshop\DateCreated\DateCreated


These are the standard tags IMatch uses everywhere and which are automatically mapped between EXIF, legacy IPTC and XMP during ingest and write-back.

If you fill tags manually or via a metadata template, always fill these tags. IMatch maps these back to EXIF and IPTC during write-back.
Filling arbitrary XMP tags will do not good (yes, there are many tags with date and time in the nane and this is all messy. Thank Adobe and Japanese and the IPTC for that).

See: How IMatch uses Date and Time Information

There is usually no need to fill them manually or via a metadata template if the original file contains date and time in the standard two EXIF date and time tags.
If this does not work, check your file in the The ExifTool Command Processor and show us the data they contain.

Or, attach a sample file which produces the problem.
This is always the best when you have problems with metadata in your files. Else we can only waste time guessing what the problem is.
One usual issue is some legacy IPTC data with time stamps which takes precedence over EXIF by default and standards.

Since I've already spent several hours this week helping people with bad metadata to get their files fixed with IMatch and ExifTool. this will have to wait for a couple of days. I'm looking into other things at the moment.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

werner-k

thx for the tips, but unfortunately setting dates via templates does not work for me :(

===
when i manually update only:
- XMP::exif\DateTimeDigitized
- XMP::exif\DateTimeOriginal

the same happens and all dates are set to today

===
when i manually update:
- XMP::exif\DateTimeDigitized
- XMP::exif\DateTimeOriginal
and
- XMP::photoshop\DateCreated\DateCreated

the write-back is as expected and all dates are set correctly.

===
when i try to update via template, nothing seems to work, write-back always sets to today.

example image uploaded...

Mario

Show your template.

It is important to use the proper date and time formatting. The YYYY-MM-DD HH:MM:SS format is required. See the examples in the MD Templates help topic.
ExifTool may ignore incorrect date and time formats when writing back.

Test: Use the Metadata Panel to set a date and time. Does this stick?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

werner-k

as i wrote before:

===
when i use the metadata-panel to update e.g. XMP::exif\DateTimeOriginal it does not work. all other dates are set to today after write-back.
but when i use the metadata-panel to update XMP::exif\DateTimeOriginal AND at the same time XMP::photoshop\DateCreated\DateCreated it sticks.

in the template i try to set the other dates (that are empty) from XMP::photoshop\DateCreated\DateCreated, which has the correct date.
after running the template, the dates are shown in the metadata-panel quite ok... put they don't stick on write-back.

is there a log that i could check for what's going on during write-back? or upload...?

===
the attached image does obviously not contain any date itself. seems the date (from 2008) was only available in the imatch db and gets lost after uploading.

lbo

Quote from: werner-k on June 08, 2019, 06:09:44 PM
when i use the metadata-panel to update e.g. XMP::exif\DateTimeOriginal it does not work. all other dates are set to today after write-back.
but when i use the metadata-panel to update XMP::exif\DateTimeOriginal AND at the same time XMP::photoshop\DateCreated\DateCreated it sticks.

what happens if you only set XMP::photoshop\DateCreated\DateCreated (shown as "Date Subject Created" in the metadata panel "1 Default")?

Quote from: werner-k on June 08, 2019, 06:09:44 PM

the attached image does obviously not contain any date itself. seems the date (from 2008) was only available in the imatch db and gets lost after uploading.

you need to zip the images since the forum software strips metadata

werner-k

thx ibo for the tips!

in the meantime i found the solution to my problem - it's a combination of what mario said in the first post.

1) to set a date like XMP::exif\DateTimeOriginal from the field XMP::photoshop\DateCreated\DateCreated, you can't take the value directly, but you need to format it like:

{File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:YYYY:MM:DD hh:mm:ss}

2) to avoid that all other dates are reset to today, you can set XMP::photoshop\DateCreated\DateCreated to the value "from itself"

afterwards, the write-back sticks... and all dates are fine!
thx for your patience... :)

===
this are the template settings that work for me now:
- XMP::exif\Date TimeOriginal => {File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:YYYY:MM:DD hh:mm:ss}
- XMP::exif\Date TimeDigitized => {File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:YYYY:MM:DD hh:mm:ss}
- XMP::photoshop\DateCreated => {File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:YYYY:MM:DD hh:mm:ss}

cheers werner
---

Mario

That's quite unusual.
Please provide a sample image (ZIP it before attaching). The community software strips all metadata when recoding uploaded images.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

werner-k

ok, what's the unusual part?

did the test again with the attached file - here's what happens on my system with different template settings:

1)
XMP::exif\Date TimeDigitized => {File.MD.XMP::photoshop\DateCreated\DateCreated\0}

=> NOT OK: timedigitized not set at all, other dates reset to today,

2)
XMP::exif\Date TimeDigitized => {File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:YYYY:MM:DD hh:mm:ss}

=> NOT OK: timedigitized set to value of xmp/photoshop/datecreated, other dates reset to today

3)
XMP::exif\Date TimeDigitized => {File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:YYYY:MM:DD hh:mm:ss}
XMP::photoshop\DateCreated => {File.MD.XMP::photoshop\DateCreated\DateCreated\0}

=> NOT OK: same result as with 2) above

4)
XMP::exif\Date TimeDigitized => {File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:YYYY:MM:DD hh:mm:ss}
XMP::photoshop\DateCreated => {File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:YYYY:MM:DD hh:mm:ss}

=> OK: all dates "stick", additionally XMP::exif\Date/Time Original is set as well



Mario

Don't try to update EXIF tags in XMP (XMP-exif) directly. They will be overwritten during the re-import after the write-back.
These are mapped tags by MWG rules.
Remember that everything labeled exif inside XMP is mapped from the original EXIF data in your file during ingest.

I understand you are trying to set the two official tags I mentioned in my post above via a metadata template and these changes, although showing correctly int he Default Metadata Panel layout (Created Data and Date Subject Created) afterwards are not written correctly or revert to another value after write-back?

Show us a screen shot of your metadata template.

The sampel image has no EXIF data (or other metadata) at all. So IMatch defaults to using the "last modified on disk" timestamp as explained in the help topic I've linked above (again: How IMatch uses Date and Time Information)

This shows in the Default Metadata Panel layout.
I now change these dates to to 2019:02:01 12:00:00+02:00 in the MD Panel.
And then I write back.

Since the file has no EXIF or legacy IPTC data, MWG recommends not to cretae these legacy data segments.
IMatch hence correctly only writes the XMP record to the JPEG file.
The XMP record shows the correct dates and times as set by me in the MD Panel:

[XMP-exif]      Date/Time Original              : 2019:02:01 12:00:00+02:00
[XMP-photoshop] Date Created                    : 2019:02:01 12:00:00+02:00
[XMP-xmp]       Create Date                     : 2019:02:01 12:00:00+02:00
[XMP-xmp]       Metadata Date                   : 2019:06:09 12:20:59+02:00
[XMP-xmp]       Modify Date                     : 2019:06:09 12:20:59+02:00


I don't understand what you are trying to achieve with your metadata template for this file.
It looks like you are trying to copy non-existing XMP-exif data (e.g. XMP::exif\Date TimeDigitized) to the official XMP date and time tags.
Since your file has no EXIF data, these XMP tags will not be filled and hence will be empty in the database.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

werner-k

First of all: THX for all the efforts - all in all the process is much clearer to me now!

What I want to reach I have clearly stated in my very first post.
I do know that I only can set the XMP-exif data and not exif directly - there is a very clear warning if you try to do otherwise.
You can also see that in my statement...

Quote
... I would like to set the content of one of these tags (e.g. Created Date) to the exif-data of the jpgs.
So I used the presets to set the following tags:
- XMP::exif\DateTimeDigitized => {File.MD.XMP::xmp\CreateDate\CreateDate\0}
- XMP::exif\DateTimeOriginal => {File.MD.XMP::xmp\CreateDate\CreateDate\0}
...


I thought the syntax that I use for my examples would be obvious - seems it was not (because the arrow I used is misleading)
The format is

Take the "Fill this tag from this data" field (left of the arrow) and write its content into the "Tag" field (right side of the arrow)

So...
XMP::exif\Date TimeDigitized => {File.MD.XMP::photoshop\DateCreated\DateCreated\0}

Means...
Write content of  {File.MD.XMP::photoshop\DateCreated\DateCreated\0} into tag "XMP::exif\Date TimeDigitized"

===
As I said, I do understand now what's going on much better - thx!
But there are 2 things that I find a bit "unexpected" and were causing the confusion...

1) After updating a tag and doing a write-back, the "DateCreated" is lost in the DB, although I didn't touch it.

What is probably happening is...
In the initial scan, IM does read the file.modify date and puts it into the XMP::photoshop\DateCreated tag (only in the DB).
When I try to update only one of the other tags, like  "XMP::exif\Date TimeDigitized" and then do a write-back...
   - IM does probably write the new tag correctly to the jpg
   - but the write-back causes file.modify to be updated to "current-datetime"
   - so when IM reads the data again... it reads the new file.modify value, which is now "current-datetime"
   - and so after reading the data, the XMP::photoshop\DateCreated DB tag is finally initialized with "current-datetime" as well

For me it would be less confusing when there would be an option like let's say "Write XMP tags that are only in the DB to the file on first write-back".
So the first time I set a tag and want it to be written to the file, all currently existing tags from the DB are automatically updated.
I guess that would eliminate the unexpected "reset to today".

2) When I try to set the value of "XMP::photoshop\DateCreated" tag "from its own value", it does only work when I use the "format" option in the "from this data" area.
I would expect that to work without the necessity to use a "format" option.
But when you know it... it's OK as well...

So... hope that was a bit clearer now :D

Keep up the GREAT WORK!!!
And thx again for taking the time to answer all of our requests so quickly!

Cheers Werner

Mario

1. IMatch only writes modified metadata tags (in the database) to the file.
2. IMatch then updates the file again, mapping between XMP and EXIF, legacy IPTC and EXIF as needed.
3. Since your file does not contain an EXIF record (or IPTC, GPS record) this step does nothing.
4. IMatch then re-imports the current data of the file into the database. This brings in data that has been 'created' during write-back, digest data, checksum, metadata timestamps etc.

All this is fully automatic and you don't need to concern yourself with that. This usually just works.

Only the "last modified on disk" date and time available, because the original image has no EXIF? Set the two timestamps once (usually to the same date and time) and everything will be nice and shiny.

Just update the two official timestamps presented in the Metadata Panel. See the links I have included in my posts for the meaning of these time stamps.
Updating other timestamps manually of via a metadata template may be useless, because your timestamps may be overridden by the official tgimestamps or the mapping that takes place during import / export.

Updating timestamps other than the two standard timestamps requires deeper knowledge of the EXIF and XMP metadata standards and the mapping rules established the MWG and implemented in IMatch.

When you update metadata timestamps via an app or a metadata template you are responsible to produce the correct format with your variable or app. The Metadata Panel implements logic to ensure that date and time is transformed from the local date and time format into the correct format (including time zone offset) but that logic is not implemented for tools like Metadata Templates which can handle arbitrary tags and use user-defined variables for input.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

werner-k

as i said already. i don't have any problem anymore with it. so we can close that thread :)
cheers werner