DNG Converter preview ignores image orientation

  • 2
  • Problem
  • Updated 3 months ago
  • (Edited)
The preview embedded by Adobe DNG Converter does not reflect the Image Orientation flag from the XMP metadata. Mirrored or rotated images always show the original orientation in the preview.
Photo of Gunther Wegner

Gunther Wegner

  • 33 Posts
  • 9 Reply Likes

Posted 8 months ago

  • 2
Photo of Thomas Knoll

Thomas Knoll

  • 10 Posts
  • 4 Reply Likes
Sorry this is as designed in DNG format, not a bug.    It is the responsibility of any software that uses the embedded previews in DNG format to apply the orientation.

If Adobe changed this, then all the software that correctly applies the orientation would then break.

The reason for this design is I did not want to have re-render the embedded previews every time any software changes the orientation metadata.  That would make rotating DNG files in Bridge or Lightroom very slow.

Please report this bug against any software that is not applying the orientation correctly to embedded previews in DNG format.
Photo of Gunther Wegner

Gunther Wegner

  • 33 Posts
  • 9 Reply Likes
Thank you Thomas. Good to know! I'll implement the rotation in the client software then.
Photo of Andrew Rodney

Andrew Rodney

  • 431 Posts
  • 58 Reply Likes
So if I understand this correctly, there IS a preview in a DNG, from the DNG converter, and it is from the original raw (the embedded JPEG)? I'm not referring to a DNG preview that may be built later in ACR/LR. 
(Edited)
Photo of Thomas Knoll

Thomas Knoll

  • 10 Posts
  • 4 Reply Likes
Andrew Rodney: I don't understand what your question has to do this topic.  This is simply a question about the DNG format specification, and what orientation should be used when storing rendered previews inside the DNG.   What do originals raws have to do with anything?  My answer stated that the orientation of the previews should match the orientation of the raw data.  This allows the DNG file to rotated with a simple metadata update, and does not require re-rendering of all the embedded previews.
Photo of Andrew Rodney

Andrew Rodney

  • 431 Posts
  • 58 Reply Likes
My question is how and when that preview is generated.
(Edited)
Photo of Thomas Knoll

Thomas Knoll

  • 10 Posts
  • 4 Reply Likes
Andrew: The DNG Converter always generates its own previews in the files it writes directly from the raw image data.  It never copies existing previews from source files.
(Edited)
Photo of Andrew Rodney

Andrew Rodney

  • 431 Posts
  • 58 Reply Likes
Thanks Thomas. Are the previews generated using a specific preset matching what we could find in ACR? Using a fixed profile like Adobe Standard? Could using the camera (raw) JPEG preview be an option and maybe faster; any reason to extract rather than regenerate? I know that is a newer option in Lightroom and wonder is there is any reason to see this in the DNG converter.
Photo of Thomas Knoll

Thomas Knoll

  • 10 Posts
  • 4 Reply Likes
The previews are generated using the current adjustment settings, if any, or the default settings if not.  No, I'm not planning on updating the logic the DNG converter users to generate previews.
Photo of Andrew Rodney

Andrew Rodney

  • 431 Posts
  • 58 Reply Likes
Sorry, what current adjustment settings? I see preference's for JPEG size etc, but not for the JPEG rendering. So I figured you use some 'default' based on the camera and maybe (?) a .dcp profile. 
Photo of Thomas Knoll

Thomas Knoll

  • 10 Posts
  • 4 Reply Likes
If you process the image in Camera Raw, or Lightroom, the current settings can be saved to a sidecar XMP file.  The DNG Converter will look for sidecar XMP files to find the current settings, if none, it will use the default settings (the exact same default settings that Camera Raw or Lightroom uses).
Photo of Andrew Rodney

Andrew Rodney

  • 431 Posts
  • 58 Reply Likes
Thanks again Thomas. This new data will aid Gruther in extracting a full JPEG from a DNG using a free utility I'll post elsewhere. I just tested this and indeed it works in producing that JPEG from the DNG outside the container. 
Photo of Andrew Rodney

Andrew Rodney

  • 431 Posts
  • 58 Reply Likes
Last question: the embedded JPEG is in sRGB right no matter how one sets the camera? It's extracted untagged which kind of makes a lot of sense.
Photo of Thomas Knoll

Thomas Knoll

  • 10 Posts
  • 4 Reply Likes
Any software that cares about what color space the previews are in should read the DNG tag that specifies the color space the previews are in.  (See the tag "PreviewColorSpace" in the DNG spec).
Photo of Andrew Rodney

Andrew Rodney

  • 431 Posts
  • 58 Reply Likes
But the JPEGs previews created by Adobe in the conversion to DNG are sRGB? 
Again, thanks for your time. 
Photo of Thomas Knoll

Thomas Knoll

  • 10 Posts
  • 4 Reply Likes
With current Adobe code, previews created by the Adobe DNG Converter are either sRGB or Gray Gamma 2.2.  But any utility that you write should NOT assume that will remain so forever in future versions of Adobe code.  Non-Adobe software very well might already be using different preview color spaces.  Any code that cares what color space the previews are in should parse and use the PreviewColorSpace tag, like I said in my previous message.
Photo of Andrew Rodney

Andrew Rodney

  • 431 Posts
  • 58 Reply Likes
Got it, super clear. Thanks again Thomas.