From another forum I understood I can embed a preview image in a raw file using the following code:
exiftool '-previewImage<=IMG_1111.jpg' IMG_1111.arw
The poster tried this on Linux and it worked for him/her.
I'm a Mac and a couple of months ago I installed Exiftool via the package provided here: http://www.exiftool.org/index.html (http://www.exiftool.org/index.html)
I'm not sure which version I have.
When I try out the suggested code with a DNG file like this:
exiftool '-previewImage<=IMG_5413.JPG' IMG_5413.DNG
It doesn't work and returns:
0 image files updated
1 image files unchanged
Running exiftool --help
shows that both the ARW and DNG file format can be read and written to by Exiftool.
Why doesn't it work for me with the DNG file?
The DNG file is created on a Canon Powershot A550 using the CHDK firmware. The JPG image originates from the same camera.
If the DNG has a PreviewImage that ExifTool can extract, then you should be able to write it:
exiftool "-previewimage<=preview.jpg" some.dng
But ExifTool will not create a PreviewImage if it doesn't already exist in the DNG.
- Phil
The thing is that the DNG doesn't have a previewImage to begin with. That's why I'm trying to add it using an existing JPG. I wasn't aware that it was a requirement to already have a previewImage field before something can be written to it.
Is it possible to create a previewImage field and then write the JPG to it?
I've tried the code you provide and it doesn't do anything.
The problem is that ExifTool will not modify the directory structure of a TIFF-format image, and you must create a new image file directory in the TIFF (DNG) for the preview. So you can't use ExifTool to do this.
I would look to an Adobe utility for this functionality.
- Phil
Thank you for your fast reply.
I've used Lightroom successfully to embed a preview image in a DNG file without one, but it takes about 2-3 seconds for each. When I have a hundreds of these DNG files for a time-lapse video it can take a long time before all have a preview image appended.
I hoped a command line tool would speed up the process, but it looks I'm out of luck.