How to manipulate EXIF/IPTC/XMP as blocks in memory
Added by Harry McKame over 6 years ago
I am using the GraphicsMagick graphical package to manipulate my images. This package can extract or store metadata as memory blocks, but has very poor support for these blocks.
I can therefore use GraphicsMagick to extract the EXIF/IPTC/XMP metadata into separate memory blocks, but I cannot examine/modify the contents of these blocks.
I have therefore thought to use a combination of GraphicsMagick and Exiv2. This means that I will use GraphicsMagick to extract the metadata into memory, then use Exiv2 to analyze and modify each of the blocks in turn.
Is there an API in Exiv2 with which I could do it ?
Replies (3)
RE: How to manipulate EXIF/IPTC/XMP as blocks in memory - Added by Alan Pater over 6 years ago
Interesting. What is the command to extract these metadata blocks and what format are the blocks in?
Anyway, exiv2 can extract exif and XMP to separate blocks using the -ee and -eX command line options.
RE: How to manipulate EXIF/IPTC/XMP as blocks in memory - Added by Harry McKame over 6 years ago
I'm using API and I don't need extraction, since this is already done by GraphicsMagick.
I need a way to analyze and modify EXIF/IPTC/XMP metadata that is already extracted.
RE: How to manipulate EXIF/IPTC/XMP as blocks in memory - Added by Andreas Huggel over 6 years ago
You may be able to read the memory block using this version of ImageFactory::open or directly, with the Exif parser (and Xmp and Iptc). It depends a bit on what you have in those memory blocks and what you know about your images. At least for Exif, it is generally better if you let Exiv2 operate on the entire image (can be in memory), rather than just a buffer with the Exif data.