Skip to content
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

IMRead() with IMReadUnchanged flag ignores EXIF orientation, when it should preserve it #132

Open
Alexn117 opened this issue Oct 26, 2019 · 0 comments

Comments

@Alexn117
Copy link

It seems from the OpenCV documentation that the default behavior should be to preserve the EXIF orientation of an image, unless the IMReadIgnoreOrientation flag is set, but this is not happening.

When I use the following, to read a .png, the EXIF orientation is ignored:

img := gocv.IMRead(name, gocv.IMReadUnchanged)

But when I use IMReadColor, the orientation is preserved. This makes the .png lose it's transparency though:

img := gocv.IMRead(name, gocv.IMReadColor)

If EXIF information are embedded in the image file, the EXIF orientation will be taken into account and thus the image will be rotated accordingly except if the flag IMREAD_IGNORE_ORIENTATION is passed.
https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56

IMREAD_IGNORE_ORIENTATION  | If set, do not rotate the image according to EXIF's orientation flag.
https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga61d9b0126a3e57d9277ac48327799c80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant