Remove embedded thumbnail from DNG

Started by danph, March 08, 2024, 09:32:29 AM

Previous topic - Next topic

danph

Hello,

a little background:
it seems that my qnap NAS has issues displaying the preview of my DNG files. I contacted the support and they told me that there is an embedded thumbnail that is preventing the NAS to generate his own preview.

For this reason I would like to try deleting the thumbnail from my raw dng files.

 Anyone coul help me with a command useful to delete the preview/thumbnail from a RAW file?

thank you!

StarGeek

I would suggest making a copy of a file to test with, as there usually are mulitple places where a thumbnail image might be located.

The most likely location for JPEGs would be ThumbnailImage, but some of my sample DNG files don't have that tag.  So you'll have to see what other tags would have a preview image. Use this command to see all the preview tag names
exiftool -G1 -a -s -Preview:All file.dng

Here's an example output
C:\>exiftool -G1 -a -s -preview:all Y:\!temp\Test_DNG.dng
[PreviewIFD]    PreviewImage                    : (Binary data 96461 bytes, use -b option to extract)
[SubIFD1]       PreviewImage                    : (Binary data 69724 bytes, use -b option to extract)
[IFD0]          ThumbnailTIFF                   : (Binary data 130776 bytes, use -b option to extract)

Next, you need to remove each preview, testing to see if it is fixed each time.  If there is only one name listed for a tag, then you can do this.  I'm using ThumbnailImage for this example, as the ThumbnailTIFF listed above isn't removable.
exiftool -ThumbnailImage= Testfile.dng

If there are duplicate names listed, such as with PreviewImage, you can either remove them individually to have a targeted approach, or you can try to remove them all.

If you want to try and remove them all, you would do the same as with ThumbnailImage. There is the possibility that this may not remove them all and you would have to use the targeted approach.
exiftool -PreviewImage= Testfile.dng

To target the previews one by one, you would include the group name
exiftool -PreviewIFD:PreviewImage= Testfile.dng
and
exiftool -SubIFD1:PreviewImage= Testfile.dng

Once you figure out what works, you can replace "Testfile.dng" with the directory name where your DNGs are located.

These commands creates backup files.  Add -Overwrite_Original to suppress the creation of backup files.  Add -r to recurse into subdirectories.


* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

danph

Hi, thank you for the detailed explanation.
Unfortunately I only have one preview:

[IFD0]          ThumbnailTIFF                   : (Binary data 51576 bytes, use -b option to extract)

and it seems is not removable... I don't know why.
Unfortunately it seems that this Thumb is read bad from my NAS, since I see all the color gamma full of reds

Phil Harvey

Removing the thumbnail from IFD0 isn't something that ExifTool can currently do.

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