ExifTool Forum

ExifTool => Newbies => Topic started by: JobWellDone on December 16, 2022, 01:19:36 AM

Title: Embed an existing JPG into a DNG file as the preview image
Post by: JobWellDone on December 16, 2022, 01:19:36 AM
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 (https://file.io/G1944hPNVAjq) from what i cam tell DNG originally has preview embedded. JPEG i trying to embed is 30kb.
Title: Re: Embed an existing JPG into a DNG file as the preview image
Post by: StarGeek on December 18, 2022, 11:34:14 AM
Split off from original thread (https://exiftool.org/forum/index.php?topic=5571.0) 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?
Title: Re: Embed an existing JPG into a DNG file as the preview image
Post by: JobWellDone on December 20, 2022, 09:55:24 PM
Quote from: StarGeek on December 18, 2022, 11:34:14 AMSplit off from original thread (https://exiftool.org/forum/index.php?topic=5571.0) 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 (https://play.google.com/store/apps/details?id=com.fimagena.raw2dng&hl=en&gl=US) 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.
Title: Re: Embed an existing JPG into a DNG file as the preview image
Post by: Phil Harvey on December 21, 2022, 09:04:49 AM
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
Title: Re: Embed an existing JPG into a DNG file as the preview image
Post by: JobWellDone on January 06, 2023, 09:36:33 PM
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?


Title: Re: Embed an existing JPG into a DNG file as the preview image
Post by: Phil Harvey on January 07, 2023, 09:08:18 AM
exiftool '-previewImage<=/images/jpg/%f.jpg' -ext arw /images/arw/

- Phil