Page 1 of 1

Magick++ Error: must specify image size

Posted: 2015-06-28T23:59:15-07:00
by Utagai
Currently, I am trying to run a simple Magick++ program that opens an image file as per a tutorial's instructions:

Code: Select all

#include <Magick++.h> 
#include <iostream> 
using namespace std; 
using namespace Magick; 
int main(int argc, char **argv) 
{ 
  InitializeMagick(*argv);

  Image image("chitanda.jpg");

  return 0; 
}
However, upon trying to execute it I receive the following error:

Code: Select all

Caught Magick++ exception: testMagick: must specify image size `/test.bmp' @ error/raw.c/ReadRAWImage/136
I figured that this meant that I needed to specify the size of the image I am reading. I have tried that, and still got an error, then I decided to make an odd attempt, what if I tried to execute a useless program such as:

Code: Select all

#include <Magick++.h> 
#include <iostream> 
using namespace std; 
using namespace Magick; 
int main(int argc,char **argv) 
{ 
  return 0; 
}
Oddly enough, I get the same exact error message. What could be the cause? I have only recently began dabbling in C++, and I am even newer to Magick++. I've trawled the internet for an answer, but haven't found anything. I hope that someone here has an idea!

Re: Magick++ Error: must specify image size

Posted: 2015-06-29T00:46:03-07:00
by dlemstra
Are you sure that you are testing the correct executable? I don't see '/test.bmp' anywhere in your code.

Re: Magick++ Error: must specify image size

Posted: 2015-06-29T01:10:43-07:00
by Utagai
That is one of the reasons I am so confused.

I am definitely testing the right executable. I compile my program (without errors) which is testMagick.cpp, and execute it using ./testMagick.

Furthermore, "test.bmp" is not something I've EVER seen before! I've never made or touched or seen a file like that. I have no idea where it could be or what it is! It's totally nonsensical to me.