ExifTool Forum

General => Metadata => Topic started by: j-flex on April 29, 2011, 09:46:21 PM

Title: Extracting Previews from TIFFs
Post by: j-flex on April 29, 2011, 09:46:21 PM
I know that Photoshop routinely includes a composite version of the file in a layered TIFF, and I suspect it may also include previews and thumbnails, but ExifTool doesn't appear to be able to extract them.  Am I missing the feature?  We are working from the command line.  I know that the format is undocumented since v6.0 AFAIK and this is a bit of a pain to reverse engineer...

Thanks!!  Phil rocks!!

- J
Title: Re: Extracting Previews from TIFFs
Post by: Phil Harvey on April 30, 2011, 07:57:35 PM
Unfortunately the TIFF preview/thumbnail isn't stored as a stand-alone image, but is mixed together with other TIFF information in the file, so ExifTool doesn't extract it.  In general, ExifTool only extracts JPEG-format previews.

- Phil
Title: Re: Extracting Previews from TIFFs
Post by: gwegner on January 13, 2013, 11:03:29 AM
Hi Phil, quite some time passed since this thread was opened. Could you come up with a way to extract a preview from tiff files in the meantime? This would be much appreciated. Thank you in advance!

Update: Maybe this doc could be of help? http://www.awaresystems.be/imaging/tiff/tifftags/docs/photoshopthumbnail.html

It would be better than nothing to be able to at least get the previews from Photoshop-TIFF Files.
Title: Re: Extracting Previews from TIFFs
Post by: Phil Harvey on January 13, 2013, 01:59:25 PM
ExifTool does extract the PhotoshopThumnail you referenced from TIFF files (since it is a JPEG image).

It just doesn't extract the TIFF thumbnail (because it isn't a self-contained image file).

- Phil
Title: Re: Extracting Previews from TIFFs
Post by: gwegner on January 13, 2013, 04:21:16 PM
Is there a special command to extract this preview?
Title: Re: Extracting Previews from TIFFs
Post by: Phil Harvey on January 13, 2013, 05:41:11 PM
The command is the same for writing the value of any binary tag to a file:

exiftool -TAG -b FILE > OUTFILE

or, to create sidecar files with extension "EXT":

exiftool -TAG -b -w EXT DIR

- Phil
Title: Re: Extracting Previews from TIFFs
Post by: gwegner on January 14, 2013, 03:04:13 AM
Thank you phil.
So
exiftool -PhotoshopThumbnail -b -w jpg .
gives me a very small thumbnail (160px width) with slightly false colors.

Strange is, that even the windows explorer seems to be able to somehow get a bigger preview from that file, I'm attaching you a screenshot. So there seem to be another embedded preview in the TIFF file, do you have any idea on how to extract it?

Any help would be much appreciated, thank you.

You can download the TIFF file here: https://dl.dropbox.com/u/2088648/_temp_/Test_HDR2.tif
Title: Re: Extracting Previews from TIFFs
Post by: Phil Harvey on January 14, 2013, 07:28:49 AM
Yes, the thumbnails are typically 160x120 pixels.

There is no embedded image in your TIFF file other than the PhotoshopThumbnail.

What makes you think that the Explorer preview is contained in this file?  On the Mac, the system generates a preview from the main image and stores it in a separate file.

- Phil
Title: Re: Extracting Previews from TIFFs
Post by: gwegner on January 14, 2013, 08:40:17 AM
Okay, thank you very much. Then it seems like I will have to go the slow way and try to read in the whole tiff to render my own preview...