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

image orientation #20

Open
somaamos opened this issue Jul 22, 2023 · 2 comments
Open

image orientation #20

somaamos opened this issue Jul 22, 2023 · 2 comments

Comments

@somaamos
Copy link

this doesn't seem to support the image orientation (rotation?) tag in images, at least on windows

so for example, using canon camera, turning the camera to take a vertical image -- the image looks ok within windows and image apps, but when running split on it, the source image is obviously taken as landscape instead of portrait orientation and hence the resulting pieces don't match expectations

@whiplashoo
Copy link
Owner

Is that a tag in the file metadata? Is there a library we can use to detect this? I don't know if I would be able to test and add this myself, as I don't have a Canon camera, but I would gladly receive a PR implementing it.

@somaamos
Copy link
Author

somaamos commented Jul 23, 2023

I think this is something you have to specify to Pillow -- see this method:
https://pillow.readthedocs.io/en/stable/reference/ImageOps.html#PIL.ImageOps.exif_transpose

The orientation info is stored in exif but Pillow won't adjust automatically, needs to be told to.

I think you could make test data by rotating an image using any tool which does so by writing EXIF data instead of altering image data. Most do it this way

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

2 participants