ExifTool Forum

ExifTool => Developers => Topic started by: boxerab on August 19, 2019, 11:26:15 AM

Title: EXIF and JPEG 2000
Post by: boxerab on August 19, 2019, 11:26:15 AM
Hello from a fellow Canuck !

First of all, love this software!

Secondly, I maintain a JPEG 2000 codec https://github.com/GrokImageCompression/grok
and I am interested in extracting EXIF data from TIFF and storing in JPEG 2000.
I've looked at the exiftool code, but I was just wondering what the best approach is
to managing the good and bad EXIF tags out there, and which uuid to use.
It looks like 'JpgTiffExif->JP2' is the proper 16 byte UUID to use.
Any guidance, advice, or forewarning would be greatly appreciated.
Best,
Aaron
Title: Re: EXIF and JPEG 2000
Post by: Phil Harvey on August 19, 2019, 11:31:09 AM
Hi Aaron,

Yes, definitely use 'JpgTiffExif->JP2'.

Further than that, I don't know exactly what you are asking.  You can pretty well put any EXIF/TIFF-formatted metadata that you want in there.

- Phil

Edit:  Make sure the data starts with a TIFF header.  Digikam incorrectly writes this like a JPEG EXIF APP1 segment.
Title: Re: EXIF and JPEG 2000
Post by: boxerab on August 19, 2019, 11:40:07 AM
Thanks. I am simply going to extract the EXIF data from TIFF tag and store with EXIF uuid.
I wasn't planning on modifying the data. But you are saying this may be necessary ?
Title: Re: EXIF and JPEG 2000
Post by: Phil Harvey on August 19, 2019, 11:43:22 AM
I don't know what you mean by "extract EXIF data from TIFF tag".

Essentially, you should just remove the image data (and associated tags) from the TIFF and store the remaining TIFF structure with the EXIF uuid.

- Phil
Title: Re: EXIF and JPEG 2000
Post by: boxerab on August 19, 2019, 11:53:21 AM
Thanks, Phil, and sorry for the confusion. I am planning on using  libtiff to read the EXIF data from
TIFFTAG_EXIFIFD   directory. and then store.
Title: Re: EXIF and JPEG 2000
Post by: Phil Harvey on August 19, 2019, 11:56:18 AM
You need to store it inside IFD0.  Not just by itself.

Also, there are some very useful metadata tags in IFD0 that are part of the EXIF specification and should be copied too.

- Phil
Title: Re: EXIF and JPEG 2000
Post by: boxerab on August 19, 2019, 11:57:28 AM
Great, thanks for the tips.