Can I insert missing thumbnails in JPGs?

Started by Archive, May 12, 2010, 08:54:20 AM

Previous topic - Next topic

Archive

[Originally posted by wibbly on 2008-05-15 07:45:57-07]

A lot of software strips out embedded JPG thumbnails in JPG images. As a result, some image browsers either don't work or spend ages generating thumbnails on the fly. This is bad if they don't cache the thumbnails either.

Will ExifTool tool insert missing jpg thumbnail metadata into jpg images? If so, can someone point me to where it's described how to do this, please?

Archive

[Originally posted by exiftool on 2008-05-15 10:56:26-07]

ExifTool can be used to insert a thumbnail, but you have to
generate the thumbnail with some other utility.  The
command line looks like this:

Code:
exiftool "-thumbnailimage<=thumb.jpg" image.jpg

- Phil

Archive

[Originally posted by schtroumpftitou on 2008-05-22 22:01:22-07]

Hi,

Your solution works great on the command line, but I would like to use it inside a perl script.
I am using Exiftool 7.00 on ubuntu 8.04.

I have generated the thumbnail with ImageMagick:
Code:
convert 05_1821.jpg -thumbnail 160 exif_thumbnail.jpg

I have tried to write
Code:
$exifTool->SetNewValue("thumbnailimage", "exif_thumbnail.jpg");,
but it doesn't work, I got an error: [minor] Not a valid image for Composite:ThumbnailImage

I have also tried to read the file first:
Code:
open(DAT, $data_file) || die("Could not open file!");
@raw_data=<DAT>;
$exifTool->SetNewValue("thumbnailimage", @raw_data);
close(DAT);
but i also have an error: Odd number of elements in hash assignment at /usr/share/perl5/Image/ExifTool/Writer.pl line 177

If someone can help me on this problem it would be great.
Thanks.

Ithier

Archive

[Originally posted by exiftool on 2008-05-23 11:16:26-07]

Close, but you need to pass the image as a scalar, not an array.
I think http://www.cpanforum.com/posts/7757" target="_blank">this post
may help by showing you one way that this can be done.

 - Phil

Archive

[Originally posted by schtroumpftitou on 2008-05-24 16:34:35-07]

Thanks, it works great.

Ithier