Page 1 of 1

Knowing that an image has been loaded

Posted: 2009-07-14T07:19:15-07:00
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

Re: Knowing that an image has been loaded

Posted: 2009-07-25T09:56:35-07:00
by mkoppanen
MagickGetNumberImages might work.