DNG images shown with wrong orientation

Started by tvi55, October 15, 2016, 03:27:22 PM

Previous topic - Next topic

tvi55

I scan my slides to DNG; for technical reasons the are turned 90 degrees left during the process.

After scanning I process the images in Lightroom: I correct the orientation, do other changes and finally save the DNG preview in the image.

The DNG images are then shown correctly eg in Faststone Image Viewer, using the saved preview.

After import in IM5 they are shown with all changes done (so obviously using the preview image),
HOWEVER without the change of the orientation.

Any hints on how to solve this?

Mario

Does the EXIF orientation in the image match the orientation of the image data?
IMatch uses the EXIF orientation to tell how to rotate the image. If this does not match the orientation of your preview, you have a problem.

Also, FPV codecs have a setting which is called "auto rotate". In that case, FPV codecs automatically rotate images based on the EXIF orientation and hand them over to the asking application. This feature is apparently designed for dumb applications which don't handle the EXIF orientation tag. Since FPV does not update the EXIF orientation in that case, a non-dumb application rotates the image twice.

You can disable the auto rotate only when you install FPC codecs, as far as I remember.

IMatch in generally handles DNG files just fine. Including all possible orientations.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

tvi55

The EXIF orientation tag has the following values:

- "Horizontal (normal)" before the update
- "Rotate 90 CW" after the update

Mario

"After the update" means after you have modified the DNG file in Lr / Ps?

If the EXIF orientation says "rotate" IMatch will rotate the image (or rather, instruct DirectX to display the image rotated accordingly).
So it should be correct.

Unless Lr uses a different rotation for the preview than for the original image data, and does not reflect this in the orientation EXIF record that can be accessed by WIC. In theory the preview and the original DNG data (and all other frames within the DNG file) can have different orientation. IMatch handles that.

Best to attach a sample file or upload one somewhere. I can then check out what Lr and WIC think about the file.
I had never a similar report before and hence I cannot say more without an actual sample file.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

tvi55

Quote from: Mario on October 15, 2016, 05:06:55 PM
"After the update" means after you have modified the DNG file in Lr / Ps?
Yes

An example can be downloaded here:
https://www.magentacloud.de/lnk/p2MXoRTn

Mario

I have downloaded your sample DNG file and added it to an IMatch database.
The sample file shows up correctly oriented (sky on top).

Screen shot of the file window and the quick preview panel:



This looks OK to me. See also my remarks below.

Which WIC codec do you use?
Please select the file in the IMatch File Window and then run Help menu > Support > WIC diagnosis.
Save the results to a text file and attach. This will tell us which codec is used on your machine.
By the looks of it I would guess that either the WIC codecs installed on your system don't handle the file or get the orientation wrong.


Remarks:

I have the latest version of the FPV codecs installed and they can only see a small 1024 pixel preview image and a thumbnail, not the full image data in 100% size.
I had a similar image yesterday. Both seem to be panoramas and both are in DNG format. Processed via ACR/Lr.

When I save the file to PSD, TIFF or JPEG in Ps or Lr, IMatch can see the full data. So this is a problem in the DNG file or the DNG variant used to create the file.

It looks like Adobe has again changed the DNG format because they needed something "new" for one of their applications, and the codec vendors don't support this format variant yet.
If you use the FastPictureViewer codec pack, contact Axel from FPV and send him the sample file so he can have a look.

If you use the Microsoft codec, Microsoft would need to know about this.

If you use the Adobe DNG codec, Adobe should know better.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

tvi55

#6
Quote from: Mario on October 16, 2016, 08:35:56 AM
Screen shot of the file window and the quick preview panel:
I at least understand now that the problem must be on my side ...  :)

Quote from: Mario on October 16, 2016, 08:35:56 AM
Which WIC codec do you use?
See the result of the diagnosis. I must admit that I am not an expert on codecs.

Quote from: Mario on October 16, 2016, 08:35:56 AM
I have the latest version of the FPV codecs installed and they can only see a small 1024 pixel preview image and a thumbnail, not the full image data in 100% size.
I had a similar image yesterday. Both seem to be panoramas and both are in DNG format. Processed via ACR/Lr.
The preview image is intentionally not in full size, in Lightroom I export in medium size (Mittlere Größe) only.

The "real" (not yet processed in Lightroom) image is a 2500 dpi scan of the slide including the whole frame. Pixel size is approx. 3680 x 3680.

tvi55

Problem is solved now!

Your hint on the Fast Picture Viewer Codec reminded me that I must have it somewhere ... and yes, I acquired it once based on an earlier recommendation by you but had not installed it since I upgraded to Windows 10. I was not sure whether I would still need it.

But anyway, thank you for your swift support - and please accept my apologies for having wasted your time!


Mario

So it seems that the DNG codec included in Windows is unable to handle the whatever DNG variant your Adobe product produces.
Maybe you should send Microsoft a sample file so they can improve the DNG codec.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ooteboe

Something similar here. A .DNG thumbnail won't rotate, whatever EXIF-code I choose. Same for the viewer. I did a WIC-diagnosis as Mario explained (attachment) and it seems that there is something wrong with the codec? Can I change the codec?

Thanks, Hans

Mario

The codec cannot extract a preview or thumbnail, but returns a 1024 x 683 pixel image as the full-size image. Is this correct?
Which camera / software has produced the DNG?
Does IMatch fail to show the file?

If it was an Adobe product, try with the Adobe DNG codec. I am under the impression that Adobe changes the DNG format at a whim, whenever they want to. Of course the other codec vendors may or may not follow or add support for new features Adobe introduces in their applications. If you rely on DNG, you may be locking yourself into a life-time subscription to Adobe software...

I would need to have the file here so see what orientation data the WIC codec returns. You seem to have only the WIC codecs included in Windows, so this may be the culprit. These codecs support all standard DNG files and many vendor-specific RAW formats. Not necessarily all proprietary extensions or flavors of DNG.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ooteboe

1024 x 683 indeed. I produced a .CR2 with Canon EOS 350D. So far nothing wrong. Than I decided to experiment a bit. Turn them into DNG's with Adobe DNG converter. Everything fine in iMatch, except the fact that thmubnail and preview don't listen to EXIF-rotation anymore. Within Windows 10 (explorer) I can see the correct rotation, within iMatch I only see the non-rotated version.

Can I attach the photo? It's some 10 MB's?

Thanks, Hans

Mario

IMatch extracts the EXIF data from your DNG via ExifTool.
You can see all data, including the EXIF orientation, in the Metadata Panel. Switch to the 'Browser' mode to see all data.

To display an image in the Viewer / Quick View Panel, IMatch uses WIC codecs. It also uses the WIC codec to determine the EXIF orientation and to apply it. If the WIC codec has some problems with your images, this may also affect its ability to determine the EXIF orientation.

You can only attach files up to 2 MB to your posts in the forum. But you can send the image to my support email address (https://www.photools.com/contact). Include a link to this topic so I know what it's for.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ooteboe

Installing the original Adobe codec made the .DNG's listen to the EXIF-rotation. And the WIC diagnosis now looks more as it should be (as far as I know)  (see attachment).

Hans

Mario

This codec supports the DNG variant you use better. It is apparently able to extract a full-size preview.

But this also means that the DNG Converter version you use produces some flavor of DNG that is not supported by the DNG codecs shipped with Windows. Which means that Adobe apparently has made yet again changes to DNG not supported by Windows codecs and probably not by other software as well...

As long as you have a DNG codec from Adobe, it works. But what on platforms which don't use WIC codecs. What about long-term archival? If Adobe keeps changing the DNG formats produced by their software at a whim, I would not recommend using DNG for long-term archival or at all. Otherwise you may lock yourself into using (and paying for) Adobe software forever.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

plastikman

#15
Mario, I believe this is exactly the same problem I am having which I mailed you the .DNG file for.

It isn't exactly obvious to me how this was resolved by the users in this thread (by changing the Codec but some things have changed since 2014 I believe, I for example cannot find an Adobe DNG codec for download).


  • My original Nikon .NEF files exhibit no problems with rotation
  • Most converted DNG files with TIFF Rotation enabled have it (I reconverted them recently using the latest DNG Converter specification)
  • They are from different camera bodies (Panasonic, Fuji and Sony)
  • Windows Explorer and DxO PhotoLab show the correct rotation while IMatch shows them rotated 90º left or right
  • As the other users reported here, these .DNG files do not respond to Exif rotation
  • If I hard-write an "horizontal (no rotation)" value to the TIFF rotation field, they still don't have the right rotation in IMatch but Windows Explorer and other applications on my computer now show them in the wrong orientation

Mario

Switch IMatch to ignore the embedded preview under E > P > Cache.
Then select one of the files and do a forced refresh with Shift+Ctrl+F5. Any change?

IMatch uses the embedded preview but the other tools may not. That would explain the difference.

Run a WIC diagnosis and let us know which WIC codecs you use (standard Windows 10 or the later editions you can download for free from the MS Store and which are based on LibRaw).
All this may impact his. I'm really sick now of the "My image is rotated wrong". All I do is to load the image and tell WIC to rotate it when WIC reports than the file has a non-neutral EXIF orientation. All this should really be handled by WIC and just work.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

plastikman

#17
Quote from: Mario on April 13, 2020, 09:06:33 AM
All this may impact his. I'm really sick now of the "My image is rotated wrong". All I do is to load the image and tell WIC to rotate it when WIC reports than the file has a non-neutral EXIF orientation. All this should really be handled by WIC and just work.

I definitely don't blame it on you, as my experience is that you implement the rules/conventions as they should while others are using hacks around them. When I say "My image is rotated wrong", I just mean that the orientation as shown in IMatch is rotated versus how hit was in the real world, not putting any blame on why that happens just observing that it happens.

I will try your suggestions and report back.

plastikman

#18
Attached are the results of WIC diagnosis. It says it is using "DNG Decoder" but it is not clear to me who is the supplier of that, seems to be part of Microsoft Raw Image Codec.

Update:

I installed the Fast Picture Viewer Codec pack Trial and after doing a "Force Update" the pictures are now showing as I want them to show. Windows Explorer and PhotoLab also still show the image in the right orientation.

I am still at loss what is causing these discrepancies between applications and codecs. It is one of the weirdest things I have experienced.

E.g., if I force update the TIFF orientation Windows Explorer and PhotoLab 3 now show it rotated on its side but IMatch shows no change (how can there be no change if the hard value changed, which seems to indicate to me that there the specific value is not used in the display somehow, or like you said, maybe a cached embedded thumbnail that isn't update with the value change).

What would happen if I rewrite the hard orientation value and re-export using DNG Converter? Will this impact the embedded previews? I am afraid that other applications will then show the wrong orientation.

Do you recommend the use of Fast Picture Viewer? For the price it might be the best solution.

Mario

The FPV codecs have not been updated for a long time afaik,

The developer has been hired by Microsoft and worked on the Windows WIC codecs, among other things.
They still work great, though.

I have only removed them from my development machine to have a more realistic (aka "what IMatch users also have") environment.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

plastikman

Quote from: Mario on April 13, 2020, 12:41:38 PM
The FPV codecs have not been updated for a long time afaik,

The developer has been hired by Microsoft and worked on the Windows WIC codecs, among other things.
They still work great, though.

I have only removed them from my development machine to have a more realistic (aka "what IMatch users also have") environment.

Makes sense to keep your system in line with average user. Curious what you'll find with my image on your machine.

Funny that he moved to Microsoft and worked on the WIC codecs, which don't show my images in the right way. The $9.99 is not the end of the world but if it is not actively updated anymore it always makes me slightly wary.

Are there any other alternative paths to explore? Is there for example an Adobe DNG codec for download and install (since DNG is giving me problems).

Mario

Did you send me a sample image? I don't see anything in my inbox. But it is flooded so I might have overlooked it.

Adobe made a DNG codec once. Did you Google for it?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

plastikman

Subject line of email: Problem image for virtual rotation / rotation (user plastikman).

I indeed Googled the Adobe DNG codec but what I find is very old around 2014 time and applying to Windows 8. I think they ceased development and probably work with Microsoft directly.

Mario

You did not include a link back to this thread. Just a link to a DNG file.
This makes it hard to remember when I look at an email a week after it was discussed here.

The problem with this DNG file was peculiar.
When I process it via the standard 3rd party image library I use for IMatch, it comes out with the wrong orientation.
When I process it via my own fallback code and direct WIC routines, it comes out with the correct orientation.
Independent from whether or not I use the preview or full RAW.
The Microsoft WIC test tools display the image rotated wrong, but show the correct EXIF orientation.
Windows Explorer was able to show a preview only after I forcefully refreshed the cache for that folder several times.
All very strange.

DNG was once designed to be a standard format. But Adobe and other vendors produced so many different variations and flavors over time, it's all a bit messy by now.

I will run some extra tests as time permits and maybe hard-code the import plug-in to use my own WIC code for DNG files instead of the 3rd party image library.
Yet another thing which should just work, but does not.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

claudermilk

Quote from: plastikman on April 13, 2020, 09:48:35 AM
Do you recommend the use of Fast Picture Viewer? For the price it might be the best solution.
FYI, I still use FPV for rating my images before ingesting into IMatch. I've been on the last v2 alpha for years. I suspect development is abandoned on this, as I haven't seen any activity. With all my other software updating right now (I blame Mario with the latest IMatch updates...  :P ), this one is still sitting a the same version I last loaded.

I am going to compare IMatch vs FPV again to see if it's more efficient to just ingest right away & rate there.

Jingo

I've been using Photo Mechanic for my initial review because I bought it for a photo review... it is a powerful program and actually is also what I use to ingest the photos from my SD cards... I do all this outside of IMatch only because I only include processed or finalized JPG images in my database... so the RAW images are stored outside of IM in a parallel directory structure to my JPG photos... 

If I wasn't using PM - I'd be using FPV... very nice and quick program for RAW rendering. 

plastikman

I have Fast Raw Viewer for that, although IMatch works actually really great for me and I use it more often than not for ingest as well.

Thanks for the update Mario. I hope you can implement this change to decrease the dependence on the user side of things. Converting my RAW files to DNG and throwing out originals is one of the biggest mistakes I made (almost 10 years ago). The whole promise of future compatibility actually turns out in reverse: the converted DNG files are less compatible then the original RAW files are in my situation.

Mario

Neither RAW nor DNG is standardized for long-term archival storage. For good reasons.
DNG is and was mostly an Adobe vehicle.

If camera vendors would adopt it as the standard format, and throw out the ancient EXIF metadata in favor of XMP, the world would be a better place indeed.
But instead they produce more and more RAW variants which each camera generation, stick to the cumbersome EXIF metadata format invented 30 years ago etc...
And users, as usual, let them get away with it. And then wake up some day and wonder...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

claudermilk

Quote from: plastikman on April 15, 2020, 01:05:16 PM
I have Fast Raw Viewer for that, although IMatch works actually really great for me and I use it more often than not for ingest as well.

Thanks for the update Mario. I hope you can implement this change to decrease the dependence on the user side of things. Converting my RAW files to DNG and throwing out originals is one of the biggest mistakes I made (almost 10 years ago). The whole promise of future compatibility actually turns out in reverse: the converted DNG files are less compatible then the original RAW files are in my situation.
I remember back when DNG came out. Big promises. I took a long, hard look at the format, but there were too many red flags for me. I ended up staying away because I didn't trust that it would become a universal format. Time has proven that true.

...and now it seems even the trusty old CR2 format has become obsolete with new CR3. I guess I'll have to deal with that some day, but for now my now 10-year-old EOS 7D is still going strong (and the 20D it replaced still works fine as a backup).

Mario

Canon produced files in CRW (with THM), at times even files with .TIF extension (but RAW content), CR2 and now CR3.
Nikon had NEF, NRW and NRF.
Sony has PMP, SRF, SR2 and ARW
...

which would all be irrelevant if the camera vendors could be bothered so spend a few thousand $ per year to provide a WIC codec which handles their formats.
You buy a new camera. You install the WIC codec. Windows, IMatch and all other WIC-compliant applications can handle the format. Easy. Like with printer drivers these days.

But N-O-O-O. That would be to easy and customer-friendly. Except Nikon, none of the camera vendors seems to provide a WIC codec.
And customers let them get away with it and buy their hardware anyway...

The https://www.libraw.org/ LibRaw project is what ExifTool is for metadata. Based on Dave Coffins work. We can all be thankful for it.
It supports more RAW formats than Windows WIC codecs. And the latest Windows WIC codecs are based on LibRaw.
Which gives some hope that Microsoft is sending some money to support the project.
Or that Microsoft has also lost interest in all the many proprietary RAW formats and tries to find a cheap way to keep support running for a while...

And people wonder why I'm such a fan of open standards, non-patent-infested file formats (don't get me started on the Apple/Nokia vehicle HEIC/HEIF), metadata standards and no lock-in policies.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

plastikman

Quote from: Mario on April 15, 2020, 02:11:47 PM
Neither RAW nor DNG is standardized for long-term archival storage. For good reasons.
DNG is and was mostly an Adobe vehicle.

If camera vendors would adopt it as the standard format, and throw out the ancient EXIF metadata in favor of XMP, the world would be a better place indeed.
But instead they produce more and more RAW variants which each camera generation, stick to the cumbersome EXIF metadata format invented 30 years ago etc...
And users, as usual, let them get away with it. And then wake up some day and wonder...

I agree with the need for more standardized and modern metadata format. Unfortunately, it will never happen. Maybe if Adobe threatens to stop support new RAW formats, but likely camera manufacturers are paying them for support anyway. I believe the cinema DNG format made some inroads in the video industry together with Apple ProRes.

claudermilk

LOL, I see this still isn't a sore subject with Mario.  ;D

Don't get me wrong, I had high hopes for DNG. The concept is great, but the implementation falls far short (as Mario says, thanks manufacturers.  ::) ).

I found that the MS Store has a MS WIC codec based on libraw. I've installed that now (my Win 10 is fully updated, so it was possible). This is great since it's coming from the OS publisher--even if using 3rd party libraries--and is currently supported vs my old FastPictureViewer codecs.