readImageBlob($input); } catch (ImagickException) { throw new DecoderException('Unable to decode input'); } // decode image $image = parent::decode($imagick); // get media type enum from string media type $format = Format::tryCreate($image->origin()->mediaType()); // extract exif data for appropriate formats if (in_array($format, [Format::JPEG, Format::TIFF])) { $image->setExif($this->extractExifData($input)); } return $image; } }