Exiv2 / exiv2

Image metadata library and tools
http://www.exiv2.org/
Other
927 stars 282 forks source link

Writing XMP metadata to jp2 files erases all XMP metadata in file #2884

Closed henryborchers closed 9 months ago

henryborchers commented 9 months ago

Describe the bug

When writing any Xmp metadata to a jp2 file, the resulting file has all xmp metadata erased.

To Reproduce

Steps to reproduce the behavior:

exiv2 -px myfile.jp2

Xmp.xmp.CreateDate                           XmpText    19  2011-05-12T12:09:15
Xmp.xmp.CreatorTool                          XmpText    23  Capture One 9.3 Windows
Xmp.aux.SerialNumber                         XmpText     8  EJ031825
Xmp.aux.ImageNumber                          XmpText     6  221317
Xmp.aux.Firmware                             XmpText    96  P65+-M, Firmware: Main=5.2.2, Boot=2.3, FPGA=1.2.4, CPLD=5.0.1, PAVR=1.0.3, UIFC=1.0.1, TGEN=1.0
Xmp.photoshop.DateCreated                    XmpText    19  2011-05-12T12:09:15
Xmp.photoshop.Credit                         XmpText    14  Jenna Courtade
Xmp.photoshop.LegacyIPTCDigest               XmpText    32  549E5EDC2A6B82049187A91955643B63
Xmp.iptc.CreatorContactInfo                  XmpText     0  type="Struct"
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiEmailWork XmpText    41  digitizationservices@library.illinois.edu
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiTelWork XmpText    14  +1(217)2442062
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrPcode XmpText     5  61801
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiUrlWork XmpText    64  https://www.library.illinois.edu/preservation/digitization-servi
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrExtadr XmpText    21  1408 W. Gregory Drive
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCity XmpText     6  Urbana
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCtry XmpText    13  United States
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrRegion XmpText     8  Illinois
Xmp.dc.title                                 LangAlt     1  lang="x-default" SLC 
Xmp.dc.creator                               XmpSeq      2  University of Illinois Library, University of Illinois Library

exiv2 --Modify "set Xmp.dc.creator library" myfile.jp2

exiv2 -px myfile.jp2 

The console shows nothing.

I get the same result when I try with the C++ api as well.

This is not a problem for tiff files nor is a problem with Exif metadata. I can't speak to other file formats because I only work with jp2 and tiff files.

Desktop (please complete the following information):

henryborchers commented 9 months ago

The last version that I can confirm this working is v0.27.6.

henryborchers commented 9 months ago

Can anybody else confirm this?

kmilos commented 9 months ago

Think I might have found why. Can you please test https://github.com/Exiv2/exiv2/pull/2890?

henryborchers commented 9 months ago

@kmilos this looks like it fixes it.

After updating to 0.28 I got a lot of errors with image processing on jp2 files and I thought I was taking crazy pills.

Nice job on getting this fixed.

kmilos commented 9 months ago

Thanks for catching this and testing!

henryborchers commented 9 months ago

Thanks for catching this and testing!

@kmilos Of course! Exiv2 is one the greatest tool/friend to digital archivists. It's faster and more robust than any other alternative out there.

henryborchers commented 9 months ago

Any idea when 0.28.2 will be released? You fixed a pretty bad bug that corrupted files. I would think that it would be fast-tracked for release so it doesn't affect other people's jp2 files.

kmilos commented 9 months ago

Any idea when 0.28.2 will be released? You fixed a pretty bad bug that corrupted files. I would think that it would be fast-tracked for release so it doesn't affect other people's jp2 files.

@Exiv2/exiv2 https://github.com/Exiv2/exiv2/milestones

In the meantime, you can ask your favorite distro exiv2 package maintainer to include the relevant patch.

henryborchers commented 9 months ago

The information was right there in front of me the whole time. How embarrassing...

I actually build exiv2 from source so I can patch it myself. Good idea. Thanks!

kmilos commented 9 months ago

I actually build exiv2 from source so I can patch it myself.

The fix is already committed to the 0.28.x branch as well.