Embed an existing JPG into a DNG file as the preview image

Started by JobWellDone, December 16, 2022, 01:19:36 AM

Previous topic - Next topic

JobWellDone

Not working for me Exiftool v11.5 (forced to use this version due to access restrictions)

exiftool '-previewImage<=/storage/emulated/0/temp/preview.jpg' /storage/emulated/0/temp/raw.dng

Last command result:

    0 image files updated
    1 image files unchanged


Running time
30:03.667

Here is DNG file from what i cam tell DNG originally has preview embedded. JPEG i trying to embed is 30kb.

StarGeek

Split off from original thread due to the age of that thread.

Your link is dead, no file there.

Also, I'm assuming the file is on an android device?  Have you tried copying the file to a desktop and running your command there?
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

JobWellDone

#2
Quote from: StarGeek on December 18, 2022, 11:34:14 AMSplit off from original thread due to the age of that thread.

Your link is dead, no file there.

Also, I'm assuming the file is on an android device?  Have you tried copying the file to a desktop and running your command there?


When i run FastStone Image Viewer it does show small resolution preview so i wrongly assumed DNG had it.

Turns out preview embedded in DNG file was not in format exiftool understands because running exiftool -a -b -W %d%f_%t%-c.%s -preview:all file.dng extracted nothing.

Found a workaround, rebuilding DNG with raw2dng app. Selecting old DNG file generates preview (1024x767) and thumbnail and embeds inside newly generatef DNG file, even makes good compression of filesize (loseless i hope), then preview can be successfully changed using exiftool to higher resolution.

Phil Harvey

DNG files don't necessarily contain JPG previews, and if they don't then ExifTool won't extract it.

But I can't check your DNG because the link to your sample file doesn't work.

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

JobWellDone

Hello


This command updates single file

exiftool '-previewImage<=/images/jpg/_DSC0001.jpg' /images/arw/_DSC0001.arw


I have folder with 100 ARW images /images/arw/ and another folder with 100 JPG /images/jpg/ images with same filename only difference is extension.

What command i can use to update previews on all ARW files?



Phil Harvey

exiftool '-previewImage<=/images/jpg/%f.jpg' -ext arw /images/arw/

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