I'm trying to get QImage (or anything in PyQt4, for that matter) to load a jpg file in a script. I haven't been able to find any information on how to get it to load a jpg image as a script, lots for compiled using py2exe but I can't even get that far.
Spending some time to resolve this, I've followed a few things with no available. Looking in 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 install of pyqt4 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've also made sure that my qt.conf file is in the main python directory and it has this
[Paths]
Prefix = C:/Python27/Lib/site-packages/PyQt4
Binaries = C:/Python27/Lib/site-packages/PyQt4
I've tried adding
Plugins = C:/Python27/Lib/site-packages/PyQt4/plugins/imageformats
Plugins = C:/Python27/Lib/site-packages/PyQt4/plugins
with no luck
I'm running python 2.7.2, with PyQt4 4.9.1(both 32b), on a windows 7 64b Home Premium.
I've also tried version 4.8.1 and 4.8.5 (which I had on hand) but none of them supported jpg either. I'm at a loss. How do I get these back to being supported?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…