Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.7.0
-
None
-
Windows XP sp3. Visual Studio 2008 SP1
-
5220c371176951e12d525ac7908861d111c367d0
Description
The attached image loads successfully with QImage( const QString& ) .
But if the image data is first read to memory buffer, and QImage::fromData() is used, the image loading ends up to infinite loop within the bowels of QJpegHandler.
Also trying to use QBuffer and QImageReader to read from memory fails the same way.
#include <QtGui/QApplication> #include <QPixmap> #include <QImage> #include <QLabel> #include <QFile> int main(int argc, char *argv[]) { QApplication a(argc, argv); QString pathToImage = "image_1404.jpg"; // This loads the image successfully QImage img( pathToImage); QLabel l; l.setPixmap( QPixmap::fromImage( img)); l.show(); // This will infinite-loop in jdmarker.c QFile f( pathToImage); if( f.open( QIODevice::ReadOnly)) { QByteArray a = f.readAll(); img = QImage::fromData( a); } QLabel l2; l2.setPixmap( QPixmap::fromImage( img)); l2.show(); return a.exec(); }