Consider simple PyQt4
app, loading picture with QPixmap
and scaling with ratio.
Crucial part of code:
from PyQt4 import QtGui, QtCore
(...)
pixmap = QtGui.QPixmap("example.jpg")
pixmap = pixmap.scaled(1100, 1800, QtCore.Qt.KeepAspectRatio)
I've been surprised when I saw my photos in wrong rotation.
I suppose, the reason is that photos contain EXIF
information about camera position, which should be considered and rotation applied:
$ exiftool example.jpg | grep -i rot
Orientation : Rotate 270 CW
Auto Rotate : Rotate 270 CW
Rotation : 270
How to make this with PyQt4
, staying close to original short form of program... preferably short&sweet and pythonic way?