Magick++ Error: must specify image size

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
Utagai
Posts: 2
Joined: 2015-06-28T23:56:46-07:00
Authentication code: 6789

Magick++ Error: must specify image size

Post 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!
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Magick++ Error: must specify image size

Post by dlemstra »

Are you sure that you are testing the correct executable? I don't see '/test.bmp' anywhere in your code.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Utagai
Posts: 2
Joined: 2015-06-28T23:56:46-07:00
Authentication code: 6789

Re: Magick++ Error: must specify image size

Post 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.
Post Reply