How to read image orientation in Qt (Using stored EXIF)

Updated: QImageReader class in Qt has a new method (introduced in Qt 5.5) named transformation() which you can use for this purpose but this article still applies if you are not using 5.5 or having problems with QImageRaader. Also it is a useful example on how to use GDI in Qt.

You might have also noticed that Qt reads jpg, tif and other types of images that it supports without paying any attention to EXIF information stored in them. EXIF meta data contains highly valuable information about the characteristics of a photograph. Let’s say you want to read an image file into QImage and do some process over it. It is crucial to know what type of orientation the image needs to go through right after reading it.

Continue reading “How to read image orientation in Qt (Using stored EXIF)”