[PATCH] kdelibs/khtml/misc/loader.cpp

Pascal Létourneau pletourn at globetrotter.net
Thu Oct 28 21:36:14 BST 2004


Hi

See bug 70437

Some (invalid) png files are in fact the concatanation of two png sub-files
QMovie happily play them as a movie
Other browsers show only the first sub-file

OK to commit?

Pascal Létourneau

Index: loader.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/misc/loader.cpp,v
retrieving revision 1.176
diff -u -3 -p -r1.176 loader.cpp
--- loader.cpp  20 Oct 2004 12:06:55 -0000      1.176
+++ loader.cpp  28 Oct 2004 20:20:36 -0000
@@ -766,6 +766,8 @@ void CachedImage::data ( QBuffer &_buffe
         assert(!eof);

         formatType = QImageDecoder::formatName( (const uchar*)_buffer.buffer().data(), _buffer.size());
+        if ( strcmp( formatType, "PNG" ) == 0 )
+            formatType = 0; // Some png files contains multiple images, we want to show only the first one

         typeChecked = true;





More information about the kfm-devel mailing list