Author Topic: Open: Some metadata missing from DNG files  (Read 4669 times)

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Open: Some metadata missing from DNG files
« on: March 11, 2014, 06:06:59 AM »
In anticipation of the development stop of Nikon Capture NX2 and the fact that its “successor” NX-D will not be a good replacement for me, I have begun testing a workflow using DNG (in combination with Lightroom and Adobe Camera Raw).

In this process I noticed that PhotoMechanic does not show the focus mode ({focusmode}, e.g., AF-C or AF-S) for .dng files. It does fine for the original .nef file and the information is present in the .dng as well (exiftool is able to find it just fine), so I guess this is just a small oversight.

I also noticed that the original frame number ({fnum}, File Number in exiftool) gets replaced by the Shutter Count/Image Number and that the number of actuations ({act}) is now empty. Again all the info is present in the dng file, but PM seems to misinterpret it slightly.

Not a biggy, but still nice if this could get fixed  :)

Cheers,
Hayo
« Last Edit: May 07, 2019, 01:04:39 AM by Hayo Baan »
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Some metadata missing from DNG files
« Reply #1 on: March 11, 2014, 07:20:29 AM »
Thanks, Hayo.  I'll let Dennis know.

-Kirk

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: Some metadata missing from DNG files
« Reply #2 on: March 11, 2014, 01:15:24 PM »
Hey Hayo,

PM doesn't try to read the proprietary "DNGPrivateData" which is where Adobe tucks the maker notes into their DNG files.  So absent a maker note, PM won't get some info like Nikon's focus mode, white balance, activation count, etc.

I can look into parsing this (as Exiftool does) but it carries some risk due to the nature of maker notes being proprietary to begin with, followed by this being put into a "private" area for Adobe DNG.  Adobe has a notion of a maker note being "safe" which is to say that the offsets are self-contained (and relative to maker note, not from beginning of file).  Some camera makes write safe maker notes, some don't.  So there would be a bit of work to make parsing this "private DNG" data safe for PM.

I will investigate some more…

--dennis

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Some metadata missing from DNG files
« Reply #3 on: March 12, 2014, 02:46:22 AM »
Hi Dennis,

Ah, I see. I hadn't counted on those parts being (still) in the makernote. As I said, not a big issue, but it would be nice nevertheless ;-)

Thanks,
Hayo
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: Some metadata missing from DNG files
« Reply #4 on: March 12, 2014, 11:14:32 AM »
Ah, I see. I hadn't counted on those parts being (still) in the makernote. As I said, not a big issue, but it would be nice nevertheless ;-)

Hayo,

Yes there are a number of useful fields in the maker notes that aren't (unfortunately) part of the Exif standard.  It used to be that the serial number, for example, was only available in a maker note, but the Exif spec was updated to add this field and it is for the most part written by newer cameras / firmware.

One other big issue with maker notes: if you open a photo in something like Photoshop, then save out a JPEG, then the maker note will be gone.  Some info may be written in XMP but the entire maker note should be gone.

If you do a Save As in PM from JPEG to JPEG, then PM will actually preserve the entire Exif block which includes the maker note.

HTH…

--dennis

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Some metadata missing from DNG files
« Reply #5 on: March 12, 2014, 01:35:02 PM »
Hi Dennis,

Ah, I always save to jpg in PM, so no problem there :)
(Besides, the only time I really use JPG is when I save for web and there I never want any exif info anyway.)

Anyway, if you can get PM to read the makernotes inside DNG like you now do for e.g., NEF and CR2, that would be awesome (but not high priority).

Cheers,
Hayo
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Luiz Muzzi

  • Hero Member
  • *****
  • Posts: 704
    • View Profile
    • Luiz Muzzi Photography
Re: Some metadata missing from DNG files
« Reply #6 on: March 14, 2014, 04:21:44 AM »
Hi Dennis,

Ah, I always save to jpg in PM, so no problem there :)
(Besides, the only time I really use JPG is when I save for web and there I never want any exif info anyway.)

Anyway, if you can get PM to read the makernotes inside DNG like you now do for e.g., NEF and CR2, that would be awesome (but not high priority).

Cheers,
Hayo

Hi,
Even though I use Canon's DPP, I would like to try to use DNG in my workflow too because of the updated jpeg preview. This way it would really be wonderful if PM could read the makernotes inside DNG.
Regards,

-Luiz Muzzi

Offline bazography

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Some metadata missing from DNG files
« Reply #7 on: June 25, 2014, 12:57:47 PM »
I too am test-driving a DNG workflow, and discovered this metadata problem and this thread.

In addition to camera data missing from DNGs (so far I’ve found Actuations, Flash compensation, White balance, Focus mode, Quality) I also discovered some data actually changes, compared to the NEF. Frame number has ben mentioned already, but in addition to that:
• Lens (partial only, eg “16.0-35.0 mm f4.0” instead of “VR Zoom 16-35 mm f4G IF-ED”).
• ICC profile (the NEF shows “Nikon Adobe RGB” but the converted DNG shows “sRGB”).
• Resolution (the NEF shows 300 but the DNG shows 72.)

I agree this is not an “end of the world” issue, but I admit I would really like to be able to read all the metadata, and the fact that some of it might be inaccurate is bothersome. So ultimately I’d be thrilled if PM could make the metadata displayed for DNGs match what is seen in the original NEFs.

With the unfortunate, eventual demise of Nikon Capture NX-2, there will likely be a rather large number of people who end up using Camera Raw/DNGs with their PM workflow, so in the coming months I’m sure there will be more and more PM users grateful for any efforts with this issue.

Thanks.

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: Some metadata missing from DNG files
« Reply #8 on: June 25, 2014, 09:19:48 PM »
In addition to camera data missing from DNGs (so far I’ve found Actuations, Flash compensation, White balance, Focus mode, Quality) I also discovered some data actually changes, compared to the NEF. Frame number has ben mentioned already, but in addition to that:
• Lens (partial only, eg “16.0-35.0 mm f4.0” instead of “VR Zoom 16-35 mm f4G IF-ED”).
• ICC profile (the NEF shows “Nikon Adobe RGB” but the converted DNG shows “sRGB”).
• Resolution (the NEF shows 300 but the DNG shows 72.)

Yes there is a lot of data in the maker note and the majority of it is undocumented.  The lens info for example can be cobbled together without a maker note, but to have a more specific lens description requires a maker note.  The DNG preview is probably rendered in sRGB so that shouldn't be a problem (remember a RAW file doesn't really have any white balance, exposure compensation, resolution, or color profile etc until it is actually rendered).  And as I mentioned, if you open your RAW file (or JPEG for that matter) into Photoshop and save it (as a JPG, TIFF, PSD etc), the maker note will be deleted.

So if you really rely upon knowing this info for future file formats, may I suggest that you use the IPTC Stationery Pad during ingest and put a bunch of this info somewhere in the IPTC record (e.g. some use special instructions).  This would be preserved through edits.

Should we add the ability to read maker notes in DNG files then most or all of this data will come back.  I am still investigating this possibility.  Last time I looked the DNG private data is what it says: "private" (undocumented).  Perhaps this has already been reverse engineered by someone else (e.g. Phil Harvey).  I'll let you know on this thread if I have been able to read the DNG maker note (it's on my list).  (I'd also like to know if the embedded preview has been cropped or not).

Regards,

--dennis

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Some metadata missing from DNG files
« Reply #9 on: June 25, 2014, 10:32:01 PM »
Should we add the ability to read maker notes in DNG files then most or all of this data will come back.  I am still investigating this possibility.  Last time I looked the DNG private data is what it says: "private" (undocumented).  Perhaps this has already been reverse engineered by someone else (e.g. Phil Harvey).  I'll let you know on this thread if I have been able to read the DNG maker note (it's on my list).  (I'd also like to know if the embedded preview has been cropped or not).

Hi Dennis, Phil has indeed decoded the maker note data for dng. And yes, I would be most grateful if you could fix this and especially the crop problem as this last one is still my biggest issue currently.
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline bazography

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Some metadata missing from DNG files
« Reply #10 on: June 26, 2014, 01:37:28 AM »
(I'd also like to know if the embedded preview has been cropped or not).
... I would be most grateful if you could fix this and especially the crop problem as this last one is still my biggest issue currently.

I'm still just testing the waters with DNGs and haven't noticed any crop issues yet. What is the crop issue being referred to above?

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Some metadata missing from DNG files
« Reply #11 on: June 27, 2014, 09:25:05 AM »
Hi bazography,

The crop issue is that sometimes when you crop the image, PM show the crop marks even though the embedded jpg in the dng is already rendered with the crop applied. Doesn't do so for every cropped image, just for a few, but it's quite irritating still…
Hayo Baan - Photography
Web: www.hayobaan.nl