I need some of my images to display in the same orientation, whether the software reads exif data or not. One solution (the only thing that could actually fit) was to rotate the image according to the exif tag, if it exists, and then remove or change the tag to "1".
Example
Say the image has an exif Orientation tag set to 3. What I want to do is rotate this image to match that tag and save it that way. So software that does not interpret exif will still display it in a good orientation. Although if the orientation of the exif tag is still 3, then the software that Exif interprets will rotate my already rotated image. So I want to set this tag to 1 (which means: lack of orientation) or delete it.
My ultimate goal is that the image will always be displayed the same, no matter what software I use to open it.
There are many questions about this, Exif and Python, blah blah blah. Here is a list of the libraries I've heard of:
- Pyexiv2: Not suitable, I'm currently using Python 3.3 with a pad.
- Gexiv2: It looks like a specific platform for a specific platform.
- EXIF.py
- Pexif : looks like the last?
What are the best practices? Is there a clean python solution? (Which I could install with pip and put it in my requirements .txt file) Is there any new lib I could use that is specific to Python3?
My only problem right now is to modify and write this exif data to an image file. I have no problem reading exif data and rotating the image according to the orientation tag. Any tips or tricks on this?
python python-imaging-library exif
Depado
source share