Code: Select all
#include <iostream>
#include <Magick++.h>
#include <string>
using namespace Magick;
using namespace std;
int main(int argc, char *argv[]) {
Image *source_img;
if (argc < 2)
return -1;
source_img = new Image();
try {
cout << "loading: " << argv[1] << endl;
source_img->read(string(argv[1])); //this line fails
cout << "loaded" << endl;
} catch (const exception &error) {
throw;
}
delete source_img;
source_img = NULL;
return 0;
}
run command:
Code: Select all
./test http://static.flickr.com/85/206793522_f5b98bed68_o.jpg
http://static.flickr.com/85/206793522_f5b98bed68.jpg
http://static.flickr.com/85/206793522_f5b98bed68_b.jpg