Can I insert missing thumbnails in TIFFs?

Started by rjlittlefield, July 10, 2015, 05:14:46 PM

Previous topic - Next topic

rjlittlefield

I've read "Can I insert missing thumbnails in JPGs?".

The technique described there works fine for me using JPG:

exiftool "-thumbnailimage<=thumb.jpg" image.jpg
    1 image files updated


But when I try it with TIFF, nothing happens:

exiftool "-thumbnailimage<=thumb.jpg" image.tif
    0 image files updated
    1 image files unchanged


Is what I'm trying to do possible? 

Any idea what's going wrong for me? 

(I've tried with both 8- and 16-bit TIFF, from a couple of different programs.  thumb.jpg is 160x120 pixels, file length 21629 bytes or 6917 bytes depending on how I created it.  Results look the same in all cases: 0 updated, 1 unchanged.  Thumbnail and image files are being found OK, because if I change names within the command I get appropriate file not found messages.  Can't think what else to try.)

Thanks!
--Rik


rjlittlefield

Adding some information...

I repeated the attempt to insert thumbnail in TIFF, but using -v5 to get as much information as possible.

Here are the results:

exiftool -v5 "-thumbnailimage<=thumb.jpg" image2.tif
Writing Composite:ThumbnailImage
Writing IFD1:ThumbnailOffset
Writing IFD0:ThumbnailOffset
Writing SubIFD:ThumbnailOffset
Writing IFD1:ThumbnailLength
Writing IFD0:ThumbnailLength
Writing SubIFD:ThumbnailLength
Writing MIE-Thumbnail:ThumbnailImage
Writing FotoStation:ThumbnailImage if tag exists
Writing Olympus:ThumbnailImage if tag exists
Writing CanonRaw:ThumbnailImage if tag exists
Writing XMP-xmp:ThumbnailImage if tag exists
======== image2.tif
Rewriting image2.tif...
  Editing tags in: Composite ExifIFD FotoStation IFD0 IFD1 MIE-Thumbnail MakerNo
tes SubIFD TIFF XMP
  Creating tags in: Composite IFD0 IFD1 MIE-Thumbnail SubIFD TIFF
  FileType = TIFF
  FileTypeExtension = TIF
  MIMEType = image/tiff
  ExifByteOrder = II
  Rewriting IFD0
  Rewriting ICC_Profile
  Copying 396 image data blocks
Nothing changed in image2.tif
    0 image files updated
    1 image files unchanged


I guess this looks like I just replaced an existing thumbnail with another copy of the same thing, but that's not the case.  The file thumb.jpg contains a placeholder image, stark white with red text "Thumb!", clearly not the same that would be present in any ordinary thumbnail for this image.  Further, when I try to extract the thumbnail after adding it, nothing comes back.  This is from a Windows 7 command prompt window, headers deleted:


exiftool -b -thumbnailimage image2.tif > tifthumb.jpg
dir tifthumb.jpg
   07/12/2015  12:11 PM                 0 tifthumb.jpg


Again, doing the insert and extract with image2.jpg instead of .tif works fine, and the thumbnail I get back matches the thumbnail I inserted.

I assume that I'm doing something wrong, but at the moment I'm clueless about what it is.  All suggestions appreciated.

Thanks!
--Rik

Phil Harvey

Hi Rik,

If I recall correctly, TIFF images don't support a JPEG thumbnail.  But I would have to consult the TIFF documentation to be sure.

- 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 ($).

rjlittlefield

Phil,

Thanks for your assistance!

I forgot to mention: I tried also with a thumbnail saved as TIFF, same results.

I don't really care what format I have to use.  I'm just trying to provide file browsers with some idea what the image is, without having to read the whole file.  If there are other options (PreviewImage?), that would be OK too.

--Rik

Phil Harvey

Hi Rik,

ExifTool won't store a TIFF-format thumbnail because it isn't stored in one piece like a JPEG thumbnail.

So I don't think that ExifTool will do what you want for TIFF images.

- 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 ($).

rjlittlefield

Thanks!  That will save me from wasting a lot of time trying to accomplish the impossible.  :)

--Rik