lovell / sharp

High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
https://sharp.pixelplumbing.com
Apache License 2.0
28.99k stars 1.29k forks source link

Enhancement: add/update XMP and IPTC metadata #4143

Open woss opened 3 months ago

woss commented 3 months ago

Question about an existing feature

I saw that there are a lot of functions that help with changing metadata, I've also checked the tests but what I am interested is in https://github.dev/lovell/sharp/blob/eab7dc1b4942038fd824747c10b4b9eda60ca72e/src/metadata.cc#L119 and https://github.dev/lovell/sharp/blob/eab7dc1b4942038fd824747c10b4b9eda60ca72e/src/metadata.cc#L111

For example, I need to write the xmp:plus:DataMining tag as well as other IPTC tags like the WebstatementURL. How do I write these tags? Which IFD do they belong to?

I also checked the libvips docs and found that this https://www.libvips.org/API/current/libvips-header.html#vips-image-set is used to write the data based on these parts https://www.libvips.org/API/current/libvips-header.html#VIPS_META_XMP_NAME.

Currently, I use the Exiftool to write and share to process, which is quite slow for many images.

XMP:PLUS tags as described here https://exiftool.org/TagNames/PLUS.html#XMP

I would really like to understand how this can be done in sharp directly.

Thank you for the time reading and hopefully answering.

lovell commented 3 months ago

This is a future possible enhancement, which was previously hinted at in https://github.com/lovell/sharp/issues/650#issuecomment-813371338

woss commented 3 months ago

oh, right, i remember reading this at some point. thanks for the answer