ImageMagick – MagickCore, C API: Monitor or Limit Resource Consumption
Description: ImageMagick is a powerful, open-source software suite for creating, editing, converting, and manipulating images in over 200 formats. Ideal for web developers, graphic designers, and researchers, it offers versatile tools for image processing, including batch processing, format conversion, and complex image transformations.
Keywords: MagickCore, C API: Monitor or Limit Resource Consumption, Image Processing, Digital Image Editing, Image Conversion, Open-Source Software, Image Manipulation, Command-Line Image Tools

# Resource

## AcquireMagickResource

AcquireMagickResource() acquires resources of the specified type. MagickFalse is returned if the specified resource is exhausted otherwise MagickTrue.

The format of the AcquireMagickResource() method is:

    MagickBooleanType AcquireMagickResource(const ResourceType type,
      const MagickSizeType size)

A description of each parameter follows:

type
  the type of resource.
size
  the number of bytes needed from for this resource.

## AcquireUniqueFileResource

AcquireUniqueFileResource() returns a unique file name, and returns a file descriptor for the file open for reading and writing.

The format of the AcquireUniqueFileResource() method is:

    int AcquireUniqueFileResource(char *path)

A description of each parameter follows:

path
  Specifies a pointer to an array of characters. The unique path name is returned in this array.

## GetMagickResource

GetMagickResource() returns the specified resource.

The format of the GetMagickResource() method is:

    MagickSizeType GetMagickResource(const ResourceType type)

A description of each parameter follows:

type
  the type of resource.

## GetMagickResourceLimit

GetMagickResourceLimit() returns the specified resource limit.

The format of the GetMagickResourceLimit() method is:

    MagickSizeType GetMagickResourceLimit(const ResourceType type)

A description of each parameter follows:

type
  the type of resource.

## ListMagickResourceInfo

ListMagickResourceInfo() lists the resource info to a file.

The format of the ListMagickResourceInfo method is:

    MagickBooleanType ListMagickResourceInfo(FILE *file,
      ExceptionInfo *exception)

A description of each parameter follows.

file

An pointer to a FILE.

exception

return any errors or warnings in this structure.

## RelinquishMagickResource

RelinquishMagickResource() relinquishes resources of the specified type.

The format of the RelinquishMagickResource() method is:

    void RelinquishMagickResource(const ResourceType type,
      const MagickSizeType size)

A description of each parameter follows:

type
  the type of resource.
size
  the size of the resource.

## RelinquishUniqueFileResource

RelinquishUniqueFileResource() relinquishes a unique file resource.

The format of the RelinquishUniqueFileResource() method is:

    MagickBooleanType RelinquishUniqueFileResource(const char *path)

A description of each parameter follows:

name
  the name of the temporary resource.

## SetMagickResourceLimit

SetMagickResourceLimit() sets the limit for a particular resource.

The format of the SetMagickResourceLimit() method is:

    MagickBooleanType SetMagickResourceLimit(const ResourceType type,
      const MagickSizeType limit)

A description of each parameter follows:

type
  the type of resource.
limit
  the maximum limit for the resource.