I'm trying to load this .tiff image into my gui interface using PyQt's QPixmap. I have the following code:
fileName = QFileDialog.getOpenFileName(self.parent, "Open Image", "/", "Image Files (*.png *.jpg *.bmp *.tiff)");
img = QtGui.QPixmap(fileName)
scaled_img = img.scaled(self.ui.img_label.size(), QtCore.Qt.KeepAspectRatio)
self.ui.img_label.setPixmap(scaled_img)
Where img_label is a Qlabel in my GUI. I tested it with various .jpg, .png and .tiff images. It seems to be working, but when I test it on this image, it returns Null
What I have tried
- I have tried printing
QImageReader.supportedImageFormatsand it shows that.tiffis supported - Also tried checking the MIME type of the image and it shows as
image/tiff
Can someone suggest what I might be doing wrong?