Crash on function "read("...")"
Posted: 2016-11-01T04:48:47-07:00
Hello. Could you please, help me? I use ImageMagick 6.9.6 on Windows in my Qt project. Everything runs perfectly except for the
function. Intercepted exception looks like this
Help me please in solving this problem… Below is the example of the code of simple console application in QtCreator
Code: Select all
Magick::Image image; image.read("2.jpg")
Code: Select all
consolemagick.exe: UnableToOpenBlob `2.jpg': No such file or directory @ error/blob.c/OpenBlob/2705
Code: Select all
#include <iostream>
#include <Magick++.h>
#include <Magick++/Image.h>
#include <Magick++/Blob.h>
#include <magick/blob.h>
using namespace std;
int main(int argc, char *argv[])
{
Magick::InitializeMagick(*argv);
cout << "Hello World!" << endl;
Magick::Image img;
try{
img.read("2.jpg");
}catch(Magick::Exception &error_){
cout<<error_.what();
return 1;
}
cout<<img.geometry().width();
return 0;
}