Page 1 of 1

How to Discern Status of Operation

Posted: 2012-06-05T12:49:12-07:00
by BradM
I just started experimenting with ImageMagick.

I am curious if there is an easy way to programmatically discern if an operation worked properly or not.

Is these a status field available after an ImageMagick command is processed?

I have read a bit about logging and debug, but I don't quite understand things.

Thanks,
Brad

Re: How to Discern Status of Operation

Posted: 2012-06-05T14:23:52-07:00
by Bonzo
How are you using Imagemagick?

At the end you either get a 1 or 0 for sucess or fail although I can not remember which is which; but a good indication is if you have a new image or not :D

Re: How to Discern Status of Operation

Posted: 2012-06-05T14:44:02-07:00
by BradM
Bonzo,

I was hoping to use ImageMagick as part of an "unattended" process that runs at night. Part of this larger process will be to trim down serveral generated images to a better size.

In your post, you mention that you get either a 0 or a 1. This sounds like exactly what I am looking for. Where are these values stored? How can I access these values?

Thanks,
Brad

Re: How to Discern Status of Operation

Posted: 2012-06-05T17:07:48-07:00
by anthony
Without knowing what you are using to call ImageMagick it is hard to help you.

You can also do various checks of results, as a 'sanity check'.

Typically if IM does fail it will raise an exception (A error of various levels from warning through to fatal).
If no exception is raised then you have a bug!

This is over and above valid return status of a operation, whcih either returnsa Boolean of true (good) or false (bad), when an operation is applied to the given image, OR a new image/NULL if that is what is needed.

Again it is hard to help without knowing your call environment.

Re: How to Discern Status of Operation

Posted: 2012-06-05T19:19:00-07:00
by BradM
Anthony,

Sorry, I should have spelled things out better.

I am planning to call ImageMagick from a Microsoft Access application (VBA). The purpose of the call is to trim off excess white space from images.

I have the call from Access set up and working. This will be part of an unattended automated process. I am trying to figure out how to capture the "return code" from IM in the event that something does not work properly.

Thanks for your assistance.

Brad

Re: How to Discern Status of Operation

Posted: 2012-06-05T20:27:27-07:00
by anthony
Capturing the exception probably makes the best sense.

Re: How to Discern Status of Operation

Posted: 2012-06-05T20:30:16-07:00
by fmw42
Possibly see -regard-warnings at http://www.imagemagick.org/Usage/basics/#controls