0

I'm using imagemagick to convert a large set of tif images to jpg, using this command:

find /pfad/to/pictures -name \*tif -exec convert -quality 98% "{}"  jpeg:"{}" \; -print

This means, the convert command looks like this: convert -quality 98% "myNice.tif" jpeg:"myNice.tif"

This results in an jepg image, which has -by the way .tif as filename, but this is okay, because filename (fileextension) doesn't matter in later use.

The Problem is: before converting, the tif file has different IPTC metadata, which can be shown like this (IPTC copyright info as example):

$ convert -format '%[IPTC:2:116]' myNice.tif info:
© by me

after converting

$ convert myNice.tif jpeg:myNice.tif

IPTC information are lost:

$ convert -format '%[IPTC:2:116]' myNice.tif info:
convert-im6.q16: unknown image property "%[IPTC:2:116]" @ warning/property.c/InterpretImageProperties/3831.

Question: Is there any way to preserve the IPTC (and EXIF) metadata while converting from tif to jpeg?

BTW: using exiftool is not an option, because everything should be done in on single find run.

//Edit: I'm Using ImageMagick 6.9.7-4, libtiff5 4.0.9-5ubuntu0.3, libjpeg-turbo8 1.5.2-0ubuntu5.18.04.4 and libjpeg8 8c-2ubuntu8 which are provided with Ubuntu 18.04 LTS

The Bndr
  • 13,204
  • 16
  • 68
  • 107
  • 2
    I can confirm that your code works and propagates forward the IPTC metadata with **ImageMagick** v7.0.10. – Mark Setchell Aug 21 '20 at 14:38
  • What version of ImageMagick? What version of libtiff and libjpeg? Can you post and example input tiff? – fmw42 Aug 21 '20 at 18:33
  • @fmw42 I'm Using ImageMagick 6.9.7-4, libtiff5 4.0.9-5ubuntu0.3, libjpeg-turbo8 1.5.2-0ubuntu5.18.04.4 and libjpeg8 8c-2ubuntu8 which are provided with Ubuntu 18.04 LTS – The Bndr Aug 24 '20 at 07:54
  • IM 6.9.7.4 is ancient. The current version is 6.9.11.28. Your libtiff is old also. I suggest you upgrade. But if you post an example tiff, I can test it. – fmw42 Aug 24 '20 at 16:56
  • @fmw42 Upgrade isn't easy, because I also need an 32 bit RPM set, while only 64 bit versions are available for download at imagemagick.org . And: I need RPMs which will work on different Red Hat and Ubuntu releases. So its difficult to implement this into different distribution with different versions of needed, but not shipped libraries. :-/ – The Bndr Aug 25 '20 at 10:19
  • If you post an example tiff, I will test to see if it fails on current versions. – fmw42 Aug 25 '20 at 16:29

0 Answers0