[PyKDE] imageformat plugin support in PyQt4?

Tara Hernandez tara at pixar.com
Wed Oct 18 23:32:26 BST 2006


I'm trying to get jpeg image support going via PyQt4, to no luck.  For 
example, the following C++ code:

    QApplication app(argc, argv);

    QList<QByteArray> formats = QImageReader::supportedImageFormats();

    for (QList<QByteArray>::const_iterator
        i = formats.constBegin(); i != formats.constEnd(); ++i)
        cout << string(*i) << "\n";

returns the expected list:

    bmp
    jpeg
    jpg
    mng
    pbm
    pgm
    png
    ppm
    xbm
    xpm

But my python code (using the aforementioned Qt distrib) trying to do 
the same thing skips both jpeg and mng formats:

from PyQt4.QtCore import *
from PyQt4.QtGui import *
import os
import sys
print "Supported:"
for type in QImageReader.supportedImageFormats():
   print " ",type

Supported:
  bmp
  pbm
  pgm
  png
  ppm
  xbm
  xpm

Everything I've found on the subject says if it's in the C++ side, it 
should be in the Python side as well, but that really doesn't appear to 
be the case with regards to plugin supported image formats.

Any clues for me?  Hopefully this is just me missing the appropriate 
documentation...

Thanks,
-Tara




More information about the PyQt mailing list