image does not contain geometry

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
spesho

image does not contain geometry

Post by spesho »

Code: Select all

image.read(IN_FILE);//OK
unsigned int w = image.columns(); // BAD ... some way too large number for width!!!
Geometry gg(image.rows(),image.columns());//it is OK!
Geometry g = image.geometry();//exception type:MagickOption
i have a trivial opening a file example with trying to get the dimensions of the picture/canvas !

see the comment in the code of my problem. and my big questions is why i do have an exception of type MagickOption
when trying to read the geometry of ANY file format (tried *miff *png *tif)!!!
error: "image does not contain geometry"
???
any hint will be appreciated
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: image does not contain geometry

Post by magick »

The image.geometry() method has little to do with Geometry(). image.geometry() returns the geometry for certain composite operations such as DisplaceCompositeOp so in the majority of cases it will return an exception.
Post Reply