Page 1 of 1

convert uncompressed -> compressed tif loses metadata

Posted: 2013-11-27T12:12:15-07:00
by Nick Payne
I use Silkypix to convert the raw files from my Fuji X-E1 to tif (in spite of it's abominable interface, it seems to produce the best raw conversion, but it will only save tif as uncompressed), and I then use convert to change the uncompressed tif files that Silkypix outputs to LZW compressed tif, which reduces the image sizes by about 50%. However, the conversion to compressed loses most of the image metadata - compared to the uncompressed file, the compressed tif is missing information for aperture, focal length, exposure, ISO setting, camera mode, program mode.

The command I'm using is:

Code: Select all

find . -maxdepth 1 -iname '*tif' -exec convert -compress lzw {} {} \;
and for each image it converts, I get the following series of warning/error messages:

Code: Select all

convert.im6: Incompatible type for "FileSource"; tag ignored. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/768.
convert.im6: Incompatible type for "SceneType"; tag ignored. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/768.
convert.im6: Unknown field with tag 42034 (0xa432) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/768.
convert.im6: Unknown field with tag 42035 (0xa433) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/768.
convert.im6: Unknown field with tag 42036 (0xa434) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/768.
convert.im6: Unknown field with tag 42037 (0xa435) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/768.
convert.im6: Unknown field with tag 42240 (0xa500) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/768.
OS is Ubuntu 13.10, and ImageMagick version information shows as:

Code: Select all

nick@nick-desktop:~$ convert --version
Version: ImageMagick 6.7.7-10 2013-09-10 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
Is it possible to prevent the metadata being lost when converting to compressed tif?

Re: convert uncompressed -> compressed tif loses metadata

Posted: 2013-11-27T12:34:16-07:00
by fmw42
It is possible a more current version of IM may preserve those fields. Can you post a link to one of your images for others to test on more current versions of IM.

Re: convert uncompressed -> compressed tif loses metadata

Posted: 2013-11-27T12:54:51-07:00
by snibgo
Recent versions of IM do strip aperture and other metadata.

I get around this by using the data from the original raw file. I could use exiftool to copy the data.

Re: convert uncompressed -> compressed tif loses metadata

Posted: 2013-11-28T12:16:28-07:00
by Nick Payne
snibgo wrote:Recent versions of IM do strip aperture and other metadata.
I get around this by using the data from the original raw file. I could use exiftool to copy the data.
Thanks. After your suggestion I had a look at exiftool, and I've setup the following script, which compresses the tif files and then uses exiftool to copy the metadata across from the original RAF files:

Code: Select all

#!/bin/sh
find . -maxdepth 1 -iname '*tif' -exec convert -compress lzw {} {} \;
exiftool -tagsfromfile %d%f.RAF -all:all -overwrite_original -ext tif .