Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.6.2
-
None
-
WinXP SP3
Description
After adding QImage with Format_RGB888 to clipboard and paste to third party application either image is pasted corrupted or QT application crashes with access violation.
Simple code exam that reproduces the issue.
#include <iostream> #include <QApplication> #include <QClipboard> #include <QMimeData> #include <QImage> #include <QDebug> int main(int argc, char* argv[]) { { QApplication app(argc, argv); QImage img; if (img.load("c:/WINDOWS/winnt.bmp") && !img.isNull()) { qDebug() << img.size().width() << "*" << img.size().height() << " bytecount=" << img.byteCount() << " bytesPerLine=" << img.bytesPerLine() << " depth=" << img.depth() << " format=" << img.format(); img = img.convertToFormat(QImage::Format_RGB888); qDebug() << img.size().width() << "*" << img.size().height() << " bytecount=" << img.byteCount() << " bytesPerLine=" << img.bytesPerLine() << " depth=" << img.depth() << " format=" << img.format(); QMimeData* pMimeData = new QMimeData(); pMimeData->setImageData(img); QApplication::clipboard()->setMimeData(pMimeData); } } return 0; }
After running application above run MSPaint and paste from clipboard => image is corrupted (see CorruptedImage.bmp attached)