DNG: Preview and Thumbnail

Started by Archive, May 12, 2010, 08:54:08 AM

Previous topic - Next topic

Archive

[Originally posted by bogdan on 2007-09-09 10:23:48-07]

Hi Phil,

I'm converting Canon CR2 image into DNG, using Adobe DNG Converter (default settings). Resulted DNG contains:

IFD0: 256x171 Reduced resolution image (Uncompressed)

-I assume this is thumbnail image,

SubIFD: 3516x2328 Full resolution image (JPEG Compression)

-I assume this is compressed raw image data,

SubIFD1: 1024x683 Reduced resolution image (JPEG Compression)

-I assume this is embedded preview image.

Now, if I replace embedded preview image using ExifTool (using -PreviewImage command), then embeded image inside DNG is replaced with new one as expected (and can be seen with BreezeBrowser). But after changing preview image, thumbnail image gets corrupted.... it looks like it has been partial overwritten with new preview image.

There's also a problem if I try to extract thumbnail from (not modified) DNG file: resulted jpg has zero bytes filesize. I assume this is because thumbnail inside DNG is uncompressed? And I also assume, that because of this, it's impossible to replace thumbnail image inside DNG?

In short: how to replace ThumbnailImage and PreviewImage inside DNG?

One additional question in this regard: if I replace preview image inside CR2, then PreviewImageLength (aka filesize) is automatically updated (of course), but it's ImageWidth and ImageHeight (resolution) are not. Does that matter?

Thanks for taking time,

Bogdan

Archive

[Originally posted by exiftool on 2007-09-09 13:46:22-07]

Hi Bogdan,

ExifTool can only be used to write embedded JPEG images.  It will
not write the TIFF thumbnail stored in IFD0.

I tried this on a sample CR2 DNG image here, and the IFD0
thumbnail can be read fine after writing a new Preview to the
file (using the Apple Preview utility).  So I think this may be a
problem with BreezeBrowser not working properly on an edited
file, although that would surprise me.

In my sample, there are no PreviewImageWidth/Height tags,
but if there are it would be a good idea to update those too
when writing the PreviewImage.

- Phil

Archive

[Originally posted by bogdan on 2007-09-09 15:44:16-07]

Thanks for fast response,

So, thumbnail can be extracted from any file which contains embedded thumbnail, but can't be written (or replaced) into TIFF, CR2 and DNG. I assume that's correct, because when trying that, I allways get "0 image files updated". OK, I must accept that :-(

About corrupted thumbnail inside DNG...

1st step:

I extract embedded preview from DNG and get, for example, DNGprev.jpg file, which is 1024x683 (123k filesize).

2nd step:

I have some xxx.jpg image (116k filesize), which has the same resolution (1024x683) as "Medium size" preview inside DNG has. Now I replace existing PreviewImage inside DNG with my xxx.jpg image. After that, if I view DNG with BreezeBrowser or IrfanView (I don't know any other Windows tool capable to show DNG thumbnails) then thumbnail is shown corrupted -image not recognizeable and mostly black. New preview image (xxx.jpg) is shown correct

3rd step:

I replace existing PreviewImage (which causes corrupt shown thumbnail) inside the same DNG, with original DNGprev.jpg image -I return the DNG into it's original state, so to speak.

And guess what? No problems with thumbnail -as nothing happened.

I believe it's not BreezeBrowser or IrfanView problem.... Are you sure Apple Preview doesn't generate thumbnails on-the-fly from preview image inside DNG (similar as iView MediaPro does)?

Thanks for your patience,

Bogdan

Archive

[Originally posted by exiftool on 2007-09-09 17:40:46-07]

I renamed the DNG to ".tiff" before I displayed it with Apple Preview.
Doing this effectively forces the software to display the image from
IFD0, which is a TIFF-compatible reduced-resolution image.  I am
sure that this is what Preview displayed, and it wasn't corrupted.
I am not sure, however, if this is what you are calling a thumbnail,
because it is larger than a typical thumbnail and was 256x171
pixels in my CR2 DNG sample (the same size as the image displayed
by Apple Preview, and also I just tried GraphicConverter).

But maybe there is something specific about the DNG that your
utilities are using and mine aren't (since mine only understand TIFF).

I will see if I can find a DNG utility to test this with.

- Phil

Archive

[Originally posted by bogdan on 2007-09-09 20:35:48-07]

Now I'm surprised once again -about renaming dng to tiff "feature" :-)

Of course I've tried that out and... you're right about everything:

1. It seems BreezeBrowser (quite old version here) doesn't show/render thumbnails as expected.

2. IrfanView does the job (I assume I've messed things before).

Anyway, I think, the more I read about metadata -the more I'm confused. It's 10:50PM, so time to go -before new questions arise :-)

Greetings,

Bogdan