ImageMagick: MagickCore, C API for ImageMagick: Dealing with Exceptions
Author: ImageMagick Studio LLC
Description: ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems. The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (P [cell cut: 1167 characters, first 1000 kept]
Keywords: magickcore, c, api, for, imagemagick:, dealing, with, exceptions, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand, ImageMagickObject, Swiss, Army, Knife, Image, Processing

Unix
Mac OS X
Windows
Processing
Options
Usage
MagickWand
MagickCore
PerlMagick
Magick++
Unix
Windows
Links

## AcquireExceptionInfo

AcquireExceptionInfo() allocates the ExceptionInfo structure.

The format of the AcquireExceptionInfo method is:

      ExceptionInfo *AcquireExceptionInfo(void)

## ClearMagickException

ClearMagickException() clears any exception that may not have been caught yet.

The format of the ClearMagickException method is:

      ClearMagickException(ExceptionInfo *exception)

A description of each parameter follows:

##### exception

the exception info.

## CatchException

CatchException() returns if no exceptions is found otherwise it reports the exception as a warning, error, or fatal depending on the severity.

The format of the CatchException method is:

      CatchException(ExceptionInfo *exception)

A description of each parameter follows:

##### exception

the exception info.

## DestroyExceptionInfo

DestroyExceptionInfo() deallocates memory associated with an exception.

The format of the DestroyExceptionInfo method is:

      ExceptionInfo *DestroyExceptionInfo(ExceptionInfo *exception)

A description of each parameter follows:

##### exception

the exception info.

## GetExceptionInfo

GetExceptionInfo() initializes an exception to default values.

The format of the GetExceptionInfo method is:

      GetExceptionInfo(ExceptionInfo *exception)

A description of each parameter follows:

##### exception

the exception info.

## GetExceptionMessage

GetExceptionMessage() returns the error message defined by the specified error code.

The format of the GetExceptionMessage method is:

      char *GetExceptionMessage(const int error)

A description of each parameter follows:

##### error

the error code.

## GetLocaleExceptionMessage

GetLocaleExceptionMessage() converts a enumerated exception severity and tag to a message in the current locale.

The format of the GetLocaleExceptionMessage method is:

      const char *GetLocaleExceptionMessage(const ExceptionType severity,
        const char *tag)

A description of each parameter follows:

##### severity

the severity of the exception.

##### tag

the message tag.

## InheritException

InheritException() inherits an exception from a related exception.

The format of the InheritException method is:

      InheritException(ExceptionInfo *exception,const ExceptionInfo *relative)

A description of each parameter follows:

##### exception

the exception info.

##### relative

the related exception info.

## MagickError

MagickError() calls the exception handler methods with an error reason.

The format of the MagickError method is:

      void MagickError(const ExceptionType error,const char *reason,
        const char *description)

A description of each parameter follows:

##### exception

Specifies the numeric error category.

##### reason

Specifies the reason to display before terminating the program.

##### description

Specifies any description to the reason.

## MagickFatalError

MagickFatalError() calls the fatal exception handler methods with an error reason.

The format of the MagickError method is:

      void MagickFatalError(const ExceptionType error,const char *reason,
        const char *description)

A description of each parameter follows:

##### exception

Specifies the numeric error category.

##### reason

Specifies the reason to display before terminating the program.

##### description

Specifies any description to the reason.

## MagickWarning

MagickWarning() calls the warning handler methods with a warning reason.

The format of the MagickWarning method is:

      void MagickWarning(const ExceptionType warning,const char *reason,
        const char *description)

A description of each parameter follows:

##### warning

the warning severity.

##### reason

Define the reason for the warning.

##### description

Describe the warning.

## SetErrorHandler

SetErrorHandler() sets the exception handler to the specified method and returns the previous exception handler.

The format of the SetErrorHandler method is:

      ErrorHandler SetErrorHandler(ErrorHandler handler)

A description of each parameter follows:

##### handler

the method to handle errors.

## SetFatalErrorHandler

SetFatalErrorHandler() sets the fatal exception handler to the specified method and returns the previous fatal exception handler.

The format of the SetErrorHandler method is:

      ErrorHandler SetErrorHandler(ErrorHandler handler)

A description of each parameter follows:

##### handler

the method to handle errors.

## SetWarningHandler

SetWarningHandler() sets the warning handler to the specified method and returns the previous warning handler.

The format of the SetWarningHandler method is:

      ErrorHandler SetWarningHandler(ErrorHandler handler)

A description of each parameter follows:

##### handler

the method to handle warnings.

## ThrowException

ThrowException() throws an exception with the specified severity code, reason, and optional description.

The format of the ThrowException method is:

      MagickBooleanType ThrowException(ExceptionInfo *exception,
        const ExceptionType severity,const char *reason,
        const char *description)

A description of each parameter follows:

##### exception

the exception info.

##### severity

the severity of the exception.

##### reason

the reason for the exception.

##### description

the exception description.

Discourse Server • Studio