Main Menu

EXIF and JPEG 2000

Started by boxerab, August 19, 2019, 11:26:15 AM

Previous topic - Next topic

boxerab

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

Phil Harvey

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.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

boxerab

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 ?

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

boxerab

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.

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

boxerab

Great, thanks for the tips.