-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading 16-bit DNG image returns wrong image sizes #139
Comments
To save your time see this online EXIF checker that returns resolution of 3008x2004 |
From exiv2 output it should be 3008x2000 actually:
It would be surprising, but it might just happen that the underlying LibRaw library doesn't the deal w/ the rational number format for these tags, which are more commonly integers... |
Scratch that, looks like it can read those values ok: so the issue is somewhere else... |
https://www.awaresystems.be/imaging/tiff/tifftags/defaultcropsize.html Looks like libraw gives you a few more pixels each side. It's not necessarily wrong, just doesn't correspond to the default crop. |
Digging around LibRaw a bit more, there used to be a Perhaps the |
Nope, doesn't come through w/ rawpy 0.16 and LibRaw 0.20:
I don't see |
Yep, this API change is now documented in the latest LibRaw snapshot: https://www.libraw.org/news/libraw-202110-snapshot |
Hello, I have a need to output an image with the cropped dimensions and would prefer avoiding adding another dependency for querying that information. Best, |
I was using rawpy to read 16-bit DNG images and unfortunately I found the image size returned was wrong.
To reproduce the issue, let's look at this image https://data.csail.mit.edu/graphics/fivek/img/dng/a0001-jmac_DSC1459.dng
This is a 16-bit DNG image taken by Nikon D70 back in 2004. Either download it and check EXIF locally or check it online gives the resolution to be 3008x2004 (or 2004x3008, this is not the issue).
However, if I read the image with the code snippet below. It will return Numpy tensor size of (3, 2014, 3040), which does not match the above. And surely 3008x2004 is correct.
I'm running on Ubuntu 16.04 with python 3.8.3
Any idea about the cause?
What wroth to mention is that if I open such DNG image with Ubuntu's photo editor - shotwell, it also gives the wrong image size. Could it be the because both rawpy and shotwell share the same low level library that resulted in the same wrong value?
The text was updated successfully, but these errors were encountered: