public function ImagemagickFormatMapper::getMimeTypeFromFormat in ImageMagick 8.3
Same name and namespace in other branches
- 8 src/ImagemagickFormatMapper.php \Drupal\imagemagick\ImagemagickFormatMapper::getMimeTypeFromFormat()
- 8.2 src/ImagemagickFormatMapper.php \Drupal\imagemagick\ImagemagickFormatMapper::getMimeTypeFromFormat()
Gets the MIME type of an image format.
Parameters
string $format: An image format in ImageMagick's internal representation (e.g. JPEG, GIF87, etc.).
Return value
string|null The MIME type of the specified format if the format is enabled in the toolkit, NULL otherwise.
Overrides ImagemagickFormatMapperInterface::getMimeTypeFromFormat
File
- src/
ImagemagickFormatMapper.php, line 133
Class
- ImagemagickFormatMapper
- Provides the ImageMagick format mapper.
Namespace
Drupal\imagemagickCode
public function getMimeTypeFromFormat(string $format) {
$format = mb_strtoupper($format);
if ($this
->isFormatEnabled($format)) {
return $this
->resolveEnabledFormats()[$format];
}
return NULL;
}