mirror of
https://github.com/Intervention/image.git
synced 2025-08-21 13:11:18 +02:00
Refactor BinaryImageDecoder
This commit is contained in:
@@ -15,7 +15,7 @@ use Intervention\Image\Exceptions\DecoderException;
|
|||||||
use Intervention\Image\Image;
|
use Intervention\Image\Image;
|
||||||
use Intervention\Image\Modifiers\AlignRotationModifier;
|
use Intervention\Image\Modifiers\AlignRotationModifier;
|
||||||
|
|
||||||
class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
|
class BinaryImageDecoder extends GdImageDecoder implements DecoderInterface
|
||||||
{
|
{
|
||||||
use CanDecodeGif;
|
use CanDecodeGif;
|
||||||
|
|
||||||
@@ -53,19 +53,11 @@ class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
|
|||||||
throw new DecoderException('Unable to decode input');
|
throw new DecoderException('Unable to decode input');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!imageistruecolor($gd)) {
|
// create image instance
|
||||||
imagepalettetotruecolor($gd);
|
$image = parent::decode($gd);
|
||||||
}
|
|
||||||
imagesavealpha($gd, true);
|
|
||||||
|
|
||||||
// build image instance
|
// extract & set exif data
|
||||||
$image = new Image(
|
$image->setExif($this->extractExifData($input));
|
||||||
new Driver(),
|
|
||||||
new Core([
|
|
||||||
new Frame($gd)
|
|
||||||
]),
|
|
||||||
$this->extractExifData($input)
|
|
||||||
);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// set mediaType on origin
|
// set mediaType on origin
|
||||||
|
Reference in New Issue
Block a user