Is there a preview image in iphone RAW(DNG) file?

Started by namer900, December 24, 2016, 01:21:39 AM

Previous topic - Next topic

Hayo Baan

Weird, so its not the structural change (due to writing with exiftool) that is the cause; writing back the original JPG using exiftool fixes it (which probably introduces those same changes).  :o
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

Yup.  So it is something that Windows doesn't like about the embedded previewimage itself.  Hayo had good ideas about the metadata and the image size being different.   It does seem that the size has something to do with the problem since the message changes when you change the ImageWidth/Height tags.  The last test I can think of is to see if you can get Windows to recognize the DNG if you write a different PreviewImage with the same dimensions as the original preview.

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

namer900

Done the tests:

If I take some random JPG file, resize it to 852*640 resoluton, and then embed it to the original DNG, the resulting DNG will work!(thumbnail displaying in win10, and can be opened in "Photos App"). Embedding other resolution JPGs will not work. I've tried 851*640, 426*320, 640*852, 5472*3648 JPGs.

Phil Harvey

That is very interesting.  I have no idea why the Windows DNG conversion would be so dependent on the size of the preview.

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

Phil Harvey

Wait.  There looks to also be a RowsPerStrip tag in the IFD0 that needs changing to the same as the new preview height. Setting this as well as the IFD0 ImageWidth/Height may fix things.

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

namer900

(1) JPG metadata removed.
(2) Embed JPG into original DNG
(3) changing IFD0 ImageWidth/Height
    exiftool -EXIF:IFD0:ImageWidth=4032 -EXIF:IFD0:ImageHeight=3024 d:/test/zz.DNG
(4) changing IFD0 RowsPerStrip
    exiftool -EXIF:IFD0:RowsPerStrip=3024 d:/test/zz.DNG

After above steps, the final DNG
https://1drv.ms/u/s!ApWbHSC9NoYSgn2xTEWRzRq01Lkp

still not working. (error message "We can't open this file.")  ???

Phil Harvey

OK.  Well thanks for trying.  That was my last idea.  :(

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