I am trying to use Python to resize picture.
With my camera, files are all written is landscape way.
The exif information handle a tag to ask the image viewer to rotate in a way or another.
Since most of the browser doesn't understand this information, I want to rotate the image using this EXIF information and keeping every other EXIF information.
Do you know how I can do that using Python ?
Reading the EXIF.py source code, I found something like that :
0x0112: ('Orientation',
{1: 'Horizontal (normal)',
2: 'Mirrored horizontal',
3: 'Rotated 180',
4: 'Mirrored vertical',
5: 'Mirrored horizontal then rotated 90 CCW',
6: 'Rotated 90 CW',
7: 'Mirrored horizontal then rotated 90 CW',
8: 'Rotated 90 CCW'})
How can I use this information and PIL to apply it ?
Best Answer
I finally used pyexiv2, but it is a bit tricky to install on other platforms than GNU.
If you see something that could be improved (except the fact that it is still for Python 2.5) then please let me know.