Empty XMP content when passing kXMPFiles_OpenOnlyXMP on video file
Opened this issue · 0 comments
wsyxbcl commented
I'm using the Rust crate to reproduce it, so the following reproduce code is in Rust. I'm still unsure whether this behavior is a bug or expected (It’s also possible that the video file I'm working with is non-standard. I can provide a test file if you'd like).
Expected Behaviour
xmp content should be read by passing kXMPFiles_OpenOnlyXMP
Actual Behaviour
with kXMPFiles_OpenOnlyXMP, program returns xmp with empty content (when reading mp4 video files)
Reproduce Scenario
The input media is a mp4 video file, with only_xmp:
let mut media_xmp = XmpFile::new()?;
if media_xmp
.open_file(media.clone(), OpenFileOptions::default().only_xmp())
.is_ok()
{
if let Some(xmp) = media_xmp.xmp() {
xmp_string = xmp.to_string_with_options(
ToStringOptions::default().set_newline("\n".to_string()),
)?;
println!("XMP: {}", xmp_string)
}
Output
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 6.0.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""/>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>
without only_xmp:
let mut media_xmp = XmpFile::new()?;
if media_xmp
.open_file(media.clone(), OpenFileOptions::default().only_xmp())
.is_ok()
{
if let Some(xmp) = media_xmp.xmp() {
xmp_string = xmp.to_string_with_options(
ToStringOptions::default().set_newline("\n".to_string()),
)?;
println!("XMP: {}", xmp_string)
}
Output
XMP: <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 6.0.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:xmpDM="http://ns.adobe.com/xmp/1.0/DynamicMedia/">
<xmp:CreateDate>2024-06-02T13:11:36Z</xmp:CreateDate>
<xmp:ModifyDate>2024-06-02T13:11:36Z</xmp:ModifyDate>
<xmpDM:duration rdf:parseType="Resource">
<xmpDM:value>20187</xmpDM:value>
<xmpDM:scale>1/1000</xmpDM:scale>
</xmpDM:duration>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>