Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.6.3
-
None
-
Windows XP (due to some image support being loaded dynamically)
-
1e5a471645ea8c91b0a2dc0fe019f15fdc5f9127
Description
If you call QImageReader::supportedImageFormats() before creating an image, you get only a list of formats that are supported natively, without plugins, AND QImageReader remembers this list and does not support images supported by plugins even after you create a QApplication().
(in Pythonesque syntax)
formats1 = QImageReader.supportedImageFormats()
app = QApplication([])
formats2 = QImageReader.supportedImageFormats()
p = QPixmap('something.jpg') # won't work
In the above code, formats1 and formats2 will be the same incomplete list, without JPEG. If you comment out the "formats1" line, formats2 will include JPEG.
The easiest fix is to document that QImageReader::supportedImageFormats() should not be called before QApplication() is called.
This was previously mentioned years ago here: http://lists.trolltech.com/qt-interest/2005-11/thread00422-0.html, though no bug was filed as far as I can tell. I encountered this independently.