You are here

public function ImagemagickFormatMapper::isFormatEnabled in ImageMagick 8.3

Same name and namespace in other branches
  1. 8 src/ImagemagickFormatMapper.php \Drupal\imagemagick\ImagemagickFormatMapper::isFormatEnabled()
  2. 8.2 src/ImagemagickFormatMapper.php \Drupal\imagemagick\ImagemagickFormatMapper::isFormatEnabled()

Checks if an image format is enabled in the toolkit.

Parameters

string $format: An image format in ImageMagick's internal representation (e.g. JPEG, GIF87, etc.).

Return value

bool TRUE if the specified format is enabled within the toolkit, FALSE otherwise.

Overrides ImagemagickFormatMapperInterface::isFormatEnabled

1 call to ImagemagickFormatMapper::isFormatEnabled()
ImagemagickFormatMapper::getMimeTypeFromFormat in src/ImagemagickFormatMapper.php
Gets the MIME type of an image format.

File

src/ImagemagickFormatMapper.php, line 125

Class

ImagemagickFormatMapper
Provides the ImageMagick format mapper.

Namespace

Drupal\imagemagick

Code

public function isFormatEnabled(string $format) : bool {
  $format = mb_strtoupper($format);
  return $format ? isset($this
    ->resolveEnabledFormats()[$format]) : FALSE;
}