-
Notifications
You must be signed in to change notification settings - Fork 158
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
Strange Property Names if mixing exiftool and Windows Explorer for http://ns.microsoft.com/photo/1.0/ XMP tags #271
Comments
It's always easier to diagnose these kinds of problems if you include a sample file. If you open the file in a hex editor, do you see |
I've tested this with three jpeg files. The XML in the files is as follows:
So there's nothing like A new interesting information I found is this:
|
I've created a repo with an example how to reproduce this:
|
Could this be at all related to drewnoakes/metadata-extractor#435? (a blind shoot this, so ignore if unhelpful) |
@paperboyo Thanks for pointing me to the other issues. Indeed that helped me understanding the issue a lot better.
|
I've looked through the XmpMeta class to determine whether it needs the SchemaRegistry singleton... and for certain operations it does depend on its existence, including even the GetProperty calls you make now. This is true even after XmpMeta object creation through XmpReader parsing is completed. Some thoughts on your list of possible solutions: a) The specs all say namespaces must be unique, even down to capitalization and whitespace. In essence, Phil Harvey is saying they didn't change it; they actually made a new one. It might be worth bringing it up again to see if he has new thoughts on the issue. b) I agree with you. This is not a good idea since it goes against spec. c) metadata extractor does not have this capability. All XMP parsing is offloaded to XmpMetaFactory in XmpCore. We would have to change it there. Even then, it wouldn't match with the Java implementation for reasons I'll add on at the end. d) I think this is your best bet - look for all combinations. The schema/namespace is a must-have in XMP to separate same-named properties. This leaves us in a bind for this issue and I don't see a good way out. Keep in mind that xmp-core-dotnet is a C# port of XmpCore for Java from Adobe. If we come up with a 'fix' for the C# version (or want to make any substantial additions as you suggest), it cannot be changed in the Java version without help from Adobe. However, if @drewnoakes sees some other path, we can make XmpCore dotnet changes independent of Adobe. That will lead to some output drift on the Java side. |
Summary: I get strange property names in the http://ns.microsoft.com/photo/1.0/ XMP namespace if mixing JPEGs that have their XMP metadata changed by exiftool and Windows Explorer. Sometimes metadata-extractor prints "MicrosoftPhoto:LastKeywordXMP" and sometimes "MicrosoftPhoto_1_:LastKeywordXMP" (dito for "MicrosoftPhoto:Rating" and probably others).
This seems to be caused by exiftool and WindowsExplorer using different namespaces. exiftool uses "http://ns.microsoft.com/photo/1.0" (without final /), Windows Explorer uses "http://ns.microsoft.com/photo/1.0/". It seems that metadata-extractor tries to make XMP property names unique if it encounters situations with both namespaces and the same property. I could not reproduce this issue when loading the metadata for one single JPEG file. It only happens after loading at least 3 files.
Output of
Correct:
Not so correct:
(the mixup can also happen the other way round, depending on which order the files were loaded)
I changed the photos either directly in the details pane of the Windows 10 File Explorer, or with exiftool using the following command:
exiftool.exe -XMP-microsoft:RatingPercent=25 -XMP-microsoft:LastKeywordXMP+=exiftool-MSKeyword1 -XMP-microsoft:LastKeywordXMP+=exiftool-MSKeyword2 photo-exiftool.jpg
I don't know who's at fault here (exiftool, Windows Explorer, metadata-extractor). In the end, it doesn't matter. A generic metadata reader should be quite flexible and also work with slightly incorrect/unusual metadata when reading photo metadata, as many writing tools don't closely follow the (not so well defined) standards.
Do you think this can be fixed in metadata-extractor, so that no matter the slighty different XML namespaces, the property names will always be the same?
(I'm actually not sure regarding URL equality, of two URLs that only differ in the trailing slash should be considered equal or not)
The text was updated successfully, but these errors were encountered: