-
Notifications
You must be signed in to change notification settings - Fork 14
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
Unable to open an XMP XML file generated by darktable #234
Comments
@tlhunter thank you for the clear bug report. In principle, any compliant XMP should be read by this toolkit, regardless of source. At a quick glance there are no obvious flaws with this file. I've added your test file as a test case in PR #235 and will investigate and add a fix there once I understand what's happening. |
@tlhunter as a quick workaround, I've found the following code reads your sample file correctly: let raw_xmp = std::fs::read("/path/to/TLH00526.ARW.xmp").unwrap();
let raw_xmp = String::from_utf8(raw_xmp).unwrap();
let meta = XmpMeta::from_str(&raw_xmp).unwrap();
println!("{:?}", meta); // prints metadata I'll do some more digging to see if it's an intended use case for the C++ code underlying |
Worked like a charm. Feel free to close this issue or keep it around. Perhaps there's some sort of marker in binary files with an offset for where the XMP is located which is missing for a pure text file? |
@tlhunter dug into this a bit more. It looks like this was an intentional design decision in the underlying C++ XMP Toolkit. The call to There does not appear to be inherent support for raw .xmp files, so I'll be closing this as "as designed." Glad to hear the workaround I proposed above is viable for you. |
I'm attempting to open a darktable-generated XMP file. Of course it's not generated by an Adobe product so it might be a fool's errand. I'm not positive if darktable is generating a valid XMP file so I've included a copy.
Expected Behaviour
Actual Behaviour
Upon doing so I get an error that the XMP (XML) file doesn't contain XMP information:
Reproduce Scenario (including but not limited to)
Here's a copy of a darktable xmp file:
Steps to Reproduce
Platform and Version
Sample Code that illustrates the problem
Logs taken while reproducing problem
The text was updated successfully, but these errors were encountered: