-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xmp file date/time changes overwritten #1998
Comments
Aha! Moving lines 147-150 to be after lines 152-164 solves my problem and all the unit tests still pass. I'll submit a PR. |
Well done, Jim. I don't know the rationale for the convertors. This kind of manipulation should be carried out by applications and should not be in the metadata engine. |
I agree, but I'm happy to live with it now I know it's there. (Using clearExifData() and clearIptcData() immediately after opening an xmp file does the job.) I think my changes honour the intent of the authors of those bits of xmpsidecar.cpp as it makes the "restore dates if they lost their TZ info" step part of the copying back of Exif & Iptc, all of which are selectively undone by the final "restore tags which were modified by the convertors" step. |
I've submitted a test file now that I've understood the test system a bit. |
I'm revisiting a bug I raised 4 years ago https://dev.exiv2.org/issues/1313
I start with a simple XMP file with just one item of metadata:
Reading this file with libexiv2 reports the following data:
The Exif and Iptc values are synthesised in
XmpSidecar::readMetadata()
lines 110-111. (This is not the place to discuss if synthesising values is a good idea.) Note thatIptc.Application2.DigitizationTime
is not synthesised.If I change the Xmp time:
it gets changed back to its original value by
XmpSidecar::writeMetadata()
. However, if I change the date as well as the time:then the new value is not modified by
XmpSidecar::writeMetadata()
. Looking at xmpsidecar.cpp I see line 160 detects a new date/time value by comparing the first 10 characters of the string, i.e. the date but not the time!I don't really understand the intent behind all this. Lines 144-145 appear to copy exif and iptc data to xmp, regardless of what might already be in xmp. Lines 147-150 appear to try and put back the xmp values that have just been over-written, then lines 152-164 appear to try and restore date/time stamps. Would this even be needed if the iptc time values had been synthesised as they have time zone info anyway.
The text was updated successfully, but these errors were encountered: