Knowing that an image has been loaded

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
atobe

Knowing that an image has been loaded

Post by atobe »

Hi,

How can I reliably know that a particular MagickWand PHP resource has an image loaded in it?

My particular case is that I have a testing framework where I am receiving MagickWand resources from many different pieces of code and I want to check that each has an image loaded _before_ I start doing the test that is asked of me.

As a part of the infrastructure code I do not have access to the point at which the image is loaded, so I can not, for instance, see if MagickReadImage fails.

WandHasException will tell me if *something* is wrong, but not specifically that there is no image. I guess I could process the exception string, but that seems a bit hacky.

Is there anything better?

Many thanks,
Toby
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: Knowing that an image has been loaded

Post by mkoppanen »

MagickGetNumberImages might work.
Mikko Koppanen
My blog: http://valokuva.org
Post Reply