I am trying to get QImage (or something in PyQt4, for that matter) to load a JPG file in a script. I could not find any information on how to get it to load the jpg image as a script, a lot to compile using py2exe, but I can’t even go that far.
After spending some time to solve this problem, I kept track of several things that were not available. Looking at my site-packages / PyQt4 / plugins / imageformats folder, I have:
qgif4.dll, qico4.dll,qjpeg4.dll, qmng4.dll, qsvg4.dll, qtga4.dll, qtiff4.dll
According to QtGui.QImageReader.supportedImageFormats (), this is what my pyqt4 installation can use
[PyQt4.QtCore.QByteArray('bmp'), PyQt4.QtCore.QByteArray('pbm'), PyQt4.QtCore.QByteArray('pgm'), PyQt4.QtCore.QByteArray('png'), PyQt4.QtCore.QByteArray('ppm'), PyQt4.QtCore.QByteArray('xbm'), PyQt4.QtCore.QByteArray('xpm')]
I also made sure my qt.conf file is in the python main directory and has
[Way]
Prefix = C:/Python27/Lib/site-packages/PyQt4
Binaries = C:/Python27/Lib/site-packages/PyQt4
I tried to add
Plugins = C:/Python27/Lib/site-packages/PyQt4/plugins/imageformats
Plugins = C:/Python27/Lib/site-packages/PyQt4/plugins
no luck
Python 2.7.2 PyQt4 4.9.1 ( 32b) Windows 7 64b Home Premium.
4.8.1 4.8.5 ( ), jpg. . ?