Skip to content
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

Empty XMP content when using only_xmp to open video file #250

Open
wsyxbcl opened this issue Dec 5, 2024 · 1 comment
Open

Empty XMP content when using only_xmp to open video file #250

wsyxbcl opened this issue Dec 5, 2024 · 1 comment
Labels
awaiting-c++-fix Awaiting fix in C++ XMP Toolkit

Comments

@wsyxbcl
Copy link

wsyxbcl commented Dec 5, 2024

This should be an issue of the C++ SDK (kXMPFiles_OpenOnlyXMP), but I'm using the Rust crate to reproduce it, so I'm reporting it here as well. I'm 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), so I would appreciate your thoughts.

Expected Behaviour

OpenFileOptions::default().only_xmp() returns xmp

Actual Behaviour

OpenFileOptions::default().only_xmp() 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"?>
@wsyxbcl
Copy link
Author

wsyxbcl commented Dec 5, 2024

adobe/XMP-Toolkit-SDK#97

@scouten-adobe scouten-adobe changed the title Empty xmp content when using only_xmp to open video file Empty XMP content when using only_xmp to open video file Dec 12, 2024
@scouten-adobe scouten-adobe added the awaiting-c++-fix Awaiting fix in C++ XMP Toolkit label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-c++-fix Awaiting fix in C++ XMP Toolkit
Projects
None yet
Development

No branches or pull requests

2 participants