DNG composite file type information?

Started by Marsu42, December 30, 2014, 06:31:08 PM

Previous topic - Next topic

Marsu42

I'm currently trying to sort through my dng files with the help of exiftool. However, the composite information on dng files is not very verbose (i.e. non existent) and I cannot tell one file type from the other as Adobe's apps manage.

This is the information available in Lightroom for a dng file:
* DNG Version
* DNG Compatibility
* Fast Load Data (embedded or not)
* Lossy Compression (yes/no)
* Original Raw File embedded (yes/no)
* Mosaic Data (yes/no)
* Transparency Data (yes/no)
* Pixel Data Type (integer/float)
* Bits per Sample (8/14/16)
* Original Dimensions
* Dimensions (for reduced resolution lossy dng)
* Preview Dimensions

This are the dng file types I use:
1. Standard raw files (from Canon) with 14bpp mosaic
2. lossy raw 8bpp demosaiced (full res or reduced)
3. converted planar tiff 16/8/float (lossy or lossless)
4. Magic Lantern's dual iso 16bpp mosaic.

I admit I didn't take a lot of time to compare the metadata output from exiftool for all these files types and try to determine what of the information might be hidden where - it doesn't seem to be obvious to me. But if you'd like to extent exiftool to be more verbose on dng file types, I can provide tag readouts or full dng files for most of these file types.

Phil Harvey

I don't know if I understand correctly, but it seems as if you want the available metadata displayed in a way that allows you to determine a specific type of file produced by some other software.  In general, this type of functionality isn't built in to ExifTool.  But I encourage you to create a set of user-defined Composite tags to derive the information you want, and to share them with us here.

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

Marsu42

Quote from: Phil Harvey on December 30, 2014, 09:06:18 PMBut I encourage you to create a set of user-defined Composite tags to derive the information you want, and to share them with us here.

Could you please point me to the docs for user composite tags? It would need some basic branching/logic like in "if tag a is x and tag b is y, then ..." and "test tag a, b, c for value x".

This is what I've discovered for myself so far, the information is already available from exiftool but you really need to look for it. If this progresses no further for one reason or another, at least as a reference to other people trying to figure out the dng props.

* DNG Version: IFD0:DNGBackwardVersion
* DNG Compatibility: IFD0:DNGVersion
* Fast Load Data: SubIFDx:PhotometricInterpretation=34892/Linear Raw (if exists in SubIFD3 or else in SubIFD1)
* Lossy Compression: IFD0:Compression=7/JPEG (otherwise =1/Uncompressed)
* Original Raw File embedded: DNG:OriginalRawImage (if tag doesn't exists there's none)
* Mosaic Data: SubIFD:PhotometricInterpretation=32803/Color Filter Array (otherwise =34892/Linear Raw)
* Transparency Data: ? (I don't have a sample dng)
* Pixel Data Type: SubIFD:SampleFormat=3/Float (if tag doesn't exists it's Integer)
* Bits per Sample: SubIFD:BitsPerSample (SubIFD:SamplesPerPixel=1 for raw, =3 for planar)
* Original Dimensions: IFD0:OriginalDefaultFinalSize (tag only exists for reduced lossy dng)
* Dimensions: SubIFD:DefaultCropSize
* Preview Dimensions: SubIFDx:ImageHeight/ImageWidth (with PhotometricInterpretation=6/YCbCr, full-size if exist SubIFD2 or else med-size in SubIFD1)
* Magic Lantern's dual_iso: SubIFD:OpcodeList1 exists (hackish determination)

Antother hackish attempt is to tell which was the source of the lossy dng - tiff or raw. It seems for tiff sources there's the SubIFD:ChromaBlurRadius tag, but I could be wrong about this as I only tested one converted file.

I also cannot find the actual raw bit depth in the tags (it's always 16, even for files that only have 14) - probably this information is only available after de-coding the mosaic data, or I'm simply not finding the tag?

Marsu42

#3
Btw: I just saw I did a typo in the thread title, could you please change "composide" to "composite" :-p ... looks rather stupid this way, and might be harder to find when people are searching through titles.

PH Edit: Done.

Phil Harvey

The config file documentation gives details and examples of user-defined tags.  See the Composite tags section of this page.  Any Perl expression may be used in the ValueConv, with $val[0], $val[1], $val[2], etc representing the values of the Require/Desired'd tags.  More complex examples of Composite tags may be found in the Exif.pm module of the source code, and complete documentation of all the nitty-gritty details may be found in lib/Image/ExifTool/README.

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

Marsu42

Quote from: Phil Harvey on December 31, 2014, 10:25:57 AMMore complex examples of Composite tags may be found in the Exif.pm module of the source code, and complete documentation of all the nitty-gritty details may be found in lib/Image/ExifTool/README

Ah. Right. So not unexpectedly, it probably boils down to complex perl expressions :-o ... so no can do right away.

For what it's worth, I'm attaching the .bat file I'm using with JPSoft's "Take Command". It identifies the dng type and can be used with tcc right away, but the branching logic and tags contained could be converted to exiftool's composite tags by someone more able with Perl than me.