Copying a preview image from one file to another

Started by Archive, May 12, 2010, 08:53:52 AM

Previous topic - Next topic

Archive

[Originally posted by rukh on 2005-12-10 07:18:30-08]

Firstly, this is an amazing tool - I've installed Active Perl on my computer soley to use it!

The short version:

1) How do I copy a preview image (not a thumbnail) from one file to another?

2) How can I generate a new preview image (not a thumbnail) for a file?

The long version:

I take photos (and have taken many) on my Canon 300D/Digital Rebel. I take them in JPEG format. Some of these photos are in portrait mode.

I know any real image program can read the orientation flag in an image file, but windows does not, and I often use file explorer. So, I want to rotate my images 1) losslessly and 2) without losing the makers notes.

I can't seem to do this Sad All the programs I've tried either can't copy the makers notes properly or can't rotate an image losslessly. The closest I've come is by rotating the image in explorer, copying across the tags with exiftool and deleting the orientation flag. But this does not copy across the preview image... how do I do that? And on second thoughts, do I need to rotate the preview image as well?

Any other suggestions (like, "silly, just use xyz, it does it all for you") would be appreciated!!

Cheers,

Rukh

Archive

[Originally posted by exiftool on 2005-12-12 14:08:48-08]

Hi Rukh,

I know of no software that handles the preview image properly.  ExifTool is the only thing I know that will do that.

It wouldn't be a bad idea to rotate the preview image when you rotate the main image and thumbnail.  You can use ExifTool to transfer the preview image from one file to another:

Code:
   exiftool -tagsfromfile src.jpg -previewimage dst.jpg

My suggestion would be to use exiftool to extract the preview from the image, then use your favourite software to rotate the image and the preview separately, then use exiftool again to re-install the maker notes then the preview image.  It's a bit of a pain I know, but you should be able to script this to do it all in one step.

You also ask how to generate a preview image.  You can install any valid JPEG image (here called 'preview.jpg') as the preview in a file like this:

Code:
   exiftool '-previewimage<=preview.jpg' dst.jpg

Note that you can only add a preview image to an image where the maker notes support it.

I hope this helps.