How to Discern Status of Operation

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
BradM
Posts: 8
Joined: 2012-05-29T16:56:27-07:00
Authentication code: 13

How to Discern Status of Operation

Post 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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: How to Discern Status of Operation

Post 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
BradM
Posts: 8
Joined: 2012-05-29T16:56:27-07:00
Authentication code: 13

Re: How to Discern Status of Operation

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to Discern Status of Operation

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
BradM
Posts: 8
Joined: 2012-05-29T16:56:27-07:00
Authentication code: 13

Re: How to Discern Status of Operation

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to Discern Status of Operation

Post by anthony »

Capturing the exception probably makes the best sense.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to Discern Status of Operation

Post by fmw42 »

Possibly see -regard-warnings at http://www.imagemagick.org/Usage/basics/#controls
Post Reply