You are here

public function ImagemagickFormatMapperInterface::validateMap in ImageMagick 8.2

Same name and namespace in other branches
  1. 8.3 src/ImagemagickFormatMapperInterface.php \Drupal\imagemagick\ImagemagickFormatMapperInterface::validateMap()
  2. 8 src/ImagemagickFormatMapperInterface.php \Drupal\imagemagick\ImagemagickFormatMapperInterface::validateMap()

Validates the format map.

The map is an associative array with ImageMagick image formats (e.g. JPEG, GIF87, etc.) as keys and an associative array of format variables as value. Each array element is structured like the following:


  'TIFF' => [
    'mime_type' => 'image/tiff',
    'enabled' => true,
    'weight' => 10,
    'exclude_extensions' => 'tif, tifx',
  ],

The format variables are as follows:

  • 'mime_type': the MIME type of the image format. This is used to resolve the supported file extensions, e.g. ImageMagick 'JPEG' format is mapped to MIME type 'image/jpeg' which in turn will be mapped to 'jpeg jpg jpe' image file extensions.
  • 'enabled': (optional) defines if the fomat needs to be enabled within the toolkit. Defaults to TRUE.
  • 'weight': (optional) is used in cases where an image file extension is mapped to more than one ImageMagick format. It is needed in file format conversions, e.g. convert from 'png' to 'gif': shall 'GIF' or 'GIF87' internal Imagemagick format be used? The format will lower weight will be used. Defaults to 0.
  • 'exclude_extensions': (optional) is used to limit the file extensions to be supported by the toolkit, if the mapping MIME type <-> file extension returns more extensions than needed, and we do not want to alter the MIME type mapping.

Parameters

array[] $map: An associative array with formats as keys and an associative array of format variables as value.

Return value

array[][] An array of arrays of error strings.

1 method overrides ImagemagickFormatMapperInterface::validateMap()
ImagemagickFormatMapper::validateMap in src/ImagemagickFormatMapper.php
Validates the format map.

File

src/ImagemagickFormatMapperInterface.php, line 49

Class

ImagemagickFormatMapperInterface
Provides an interface for ImageMagick format mappers.

Namespace

Drupal\imagemagick

Code

public function validateMap(array $map);