Page 1 of 1

trouble reading in an image in c++

Posted: 2007-03-26T15:35:45-07:00
by jfern
Hi,

I am having trouble reading in an image using c++ on unix.
I do:

try{image[0].read("menu.tif");
} catch (exception &error_ ) {
cout<<"Caught exception: " <<error.what() << endl;
}

my program compiles(makes) fine, but when I run it I get the following:

Caught exception: ImageMagick: unable to open image `menu.tif': No such file or directory
terminate called after throwing an instance of 'Magick::ErrorResourceLimit'
what(): ImageMagick: no pixels defined in cache `menu.tif'
Abort


the menu.tif is in the same directory as my .cpp file

any help would be appreciated.
Thanks,
Josh

Re: trouble reading in an image in c++

Posted: 2007-04-04T12:42:33-07:00
by teetanne
Dear Josh,
well, the tif file and your executable should be at the same location. Otherwise you have to use an absolute path or your take the arg[]'s from the cmd line.

greetings TeeTanne