1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-20 04:31:24 +02:00

Refactor BinaryImageDecoder

This commit is contained in:
Oliver Vogel
2024-01-27 18:02:44 +01:00
parent 19578de8d4
commit e1b4649b86

View File

@@ -15,7 +15,7 @@ use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Image;
use Intervention\Image\Modifiers\AlignRotationModifier;
class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
class BinaryImageDecoder extends GdImageDecoder implements DecoderInterface
{
use CanDecodeGif;
@@ -53,19 +53,11 @@ class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
throw new DecoderException('Unable to decode input');
}
if (!imageistruecolor($gd)) {
imagepalettetotruecolor($gd);
}
imagesavealpha($gd, true);
// create image instance
$image = parent::decode($gd);
// build image instance
$image = new Image(
new Driver(),
new Core([
new Frame($gd)
]),
$this->extractExifData($input)
);
// extract & set exif data
$image->setExif($this->extractExifData($input));
try {
// set mediaType on origin