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;
}