mirror of
https://github.com/Intervention/image.git
synced 2025-08-21 21:15:11 +02:00
Remove normalizing in GD's BinaryImageDecoder
This commit is contained in:
@@ -9,7 +9,6 @@ use Intervention\Image\Interfaces\DecoderInterface;
|
|||||||
use Intervention\Image\Interfaces\ImageInterface;
|
use Intervention\Image\Interfaces\ImageInterface;
|
||||||
use Intervention\Gif\Decoder as GifDecoder;
|
use Intervention\Gif\Decoder as GifDecoder;
|
||||||
use Intervention\Gif\Splitter as GifSplitter;
|
use Intervention\Gif\Splitter as GifSplitter;
|
||||||
use Intervention\Image\Drivers\Gd\Cloner;
|
|
||||||
use Intervention\Image\Drivers\Gd\Core;
|
use Intervention\Image\Drivers\Gd\Core;
|
||||||
use Intervention\Image\Drivers\Gd\Driver;
|
use Intervention\Image\Drivers\Gd\Driver;
|
||||||
use Intervention\Image\Exceptions\DecoderException;
|
use Intervention\Image\Exceptions\DecoderException;
|
||||||
@@ -39,15 +38,16 @@ class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
|
|||||||
throw new DecoderException('Unable to decode input');
|
throw new DecoderException('Unable to decode input');
|
||||||
}
|
}
|
||||||
|
|
||||||
// clone image to normalize transparency to #ffffff00
|
if (!imageistruecolor($gd)) {
|
||||||
$normalized = Cloner::clone($gd);
|
imagepalettetotruecolor($gd);
|
||||||
imagedestroy($gd);
|
}
|
||||||
|
imagesavealpha($gd, true);
|
||||||
|
|
||||||
// build image instance
|
// build image instance
|
||||||
$image = new Image(
|
$image = new Image(
|
||||||
new Driver(),
|
new Driver(),
|
||||||
new Core([
|
new Core([
|
||||||
new Frame($normalized)
|
new Frame($gd)
|
||||||
]),
|
]),
|
||||||
$this->extractExifData($input)
|
$this->extractExifData($input)
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user