Question

With PySide 1.2.1 installed through the Canopy Package Manager, I get the following set of supported image formats:

>>> from PySide import QtGui
>>> QtGui.QImageReader.supportedImageFormats()
[PySide.QtCore.QByteArray('bmp'),
 PySide.QtCore.QByteArray('pbm'),
 PySide.QtCore.QByteArray('pgm'),
 PySide.QtCore.QByteArray('png'),
 PySide.QtCore.QByteArray('ppm'),
 PySide.QtCore.QByteArray('xbm'),
 PySide.QtCore.QByteArray('xpm')]

If I downgrade to PySide 1.1.0, I get the following:

>>> from PySide import QtGui
>>> QtGui.QImageReader.supportedImageFormats()
[PySide.QtCore.QByteArray('bmp'),
 PySide.QtCore.QByteArray('gif'),
 PySide.QtCore.QByteArray('ico'),
 PySide.QtCore.QByteArray('jpeg'),
 PySide.QtCore.QByteArray('jpg'),
 PySide.QtCore.QByteArray('mng'),
 PySide.QtCore.QByteArray('pbm'),
 PySide.QtCore.QByteArray('pgm'),
 PySide.QtCore.QByteArray('png'),
 PySide.QtCore.QByteArray('ppm'),
 PySide.QtCore.QByteArray('svg'),
 PySide.QtCore.QByteArray('svgz'),
 PySide.QtCore.QByteArray('tif'),
 PySide.QtCore.QByteArray('tiff'),
 PySide.QtCore.QByteArray('xbm'),
 PySide.QtCore.QByteArray('xpm')]

Is there some extra configuration required to restore the missing formats?

I'm running Canopy v1.3.0.1715 on Mac OS X.

Était-ce utile?

La solution

The extra image format handlers are distributed as Qt plugins, but it appears that Qt is not able to find them despite the presence of a qt.conf file. We'll get that fixed for a future release, but in the meantime you can workaround the issue by setting the QT_PLUGIN_PATH variable in the environment. For example:

export QT_PLUGIN_PATH=/Applications/Canopy.app/appdata/canopy-1.3.0.1715.macosx-x86_64/Canopy.app/Contents/plugins

[edit]

Actually the plugins fodler is properly found after the application object has been created:

>>> from PySide import QtCore, QtGui
>>> app = QtCore.QCoreApplication([])
>>> import pprint
>>> pprint.pprint(QtGui.QImageReader.supportedImageFormats())
[PySide.QtCore.QByteArray('bmp'),
 PySide.QtCore.QByteArray('gif'),
 PySide.QtCore.QByteArray('ico'),
 PySide.QtCore.QByteArray('jpeg'),
 PySide.QtCore.QByteArray('jpg'),
 PySide.QtCore.QByteArray('mng'),
 PySide.QtCore.QByteArray('pbm'),
 PySide.QtCore.QByteArray('pgm'),
 PySide.QtCore.QByteArray('png'),
 PySide.QtCore.QByteArray('ppm'),
 PySide.QtCore.QByteArray('tga'),
 PySide.QtCore.QByteArray('tif'),
 PySide.QtCore.QByteArray('tiff'),
 PySide.QtCore.QByteArray('xbm'),
 PySide.QtCore.QByteArray('xpm')]
>>>

But the svg format still seems to be MIA. I'll check into that further.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top