first-chance/unhandled exception, magick::errorblob
Posted: 2008-02-13T06:43:22-07:00
i get this message error
this is my code (im using Qt4 btw).
i've no idea why this error occurs. any help is much appreciated!
Code: Select all
First-chance exception at 0x7705b09e in imagemagick_qt.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
Unhandled exception at 0x7705b09e in imagemagick_qt.exe: Microsoft C++ exception: Magick::ErrorBlob at memory location 0x0012b288..
Code: Select all
QPixmap pix;
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open File"), QDir::currentPath());
if (!fileName.isEmpty()) {
// Read file from disk
Image image;
image.read( fileName.toStdString() ); //debugger points here
// Write to some BLOB in XPM format
Blob blob;
image.magick( "XPM" ); // Set XPM
image.write( &blob );
// Passing Image Buffer to a QPixmap
const QByteArray imgData ((char*)(blob.data()));
pix.loadFromData(imgData);
// Setting the QPixmap
imageLabel->setPixmap(pix);