]> git.sesse.net Git - mlt/commitdiff
Fix handling monochrome in qimage.
authorDan Dennedy <dan@dennedy.org>
Sun, 6 Mar 2011 07:21:07 +0000 (23:21 -0800)
committerDan Dennedy <dan@dennedy.org>
Sun, 6 Mar 2011 07:21:07 +0000 (23:21 -0800)
src/modules/qimage/qimage_wrapper.cpp

index f469877b65676e870ac02e456b1f0c6bd77f257b..abcef45449b2a332b5203eb820b961d964ba30a2 100644 (file)
@@ -264,9 +264,14 @@ void refresh_qimage( producer_qimage self, mlt_frame frame, int width, int heigh
 
 #ifdef USE_QT4
                // Note - the original qimage is already safe and ready for destruction
+               if ( qimage->depth() == 1 )
+               {
+                       QImage temp = qimage->convertToFormat( QImage::Format_RGB32 );
+                       delete qimage;
+                       qimage = new QImage( temp );
+               }
                QImage scaled = interp == 0 ? qimage->scaled( QSize( width, height ) ) :
                        qimage->scaled( QSize(width, height), Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
-               QImage temp;
                self->has_alpha = scaled.hasAlphaChannel();
 #endif