Extracting Previews from TIFFs

Started by j-flex, April 29, 2011, 09:46:21 PM

Previous topic - Next topic

j-flex

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gwegner

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.

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gwegner

Is there a special command to extract this preview?

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gwegner

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gwegner

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...