diff --git a/src/Drivers/Gd/GdDriver.php b/src/Drivers/Gd/GdDriver.php index e53c794c..ee51a2ac 100644 --- a/src/Drivers/Gd/GdDriver.php +++ b/src/Drivers/Gd/GdDriver.php @@ -680,6 +680,8 @@ protected function pngCompression(): int public function format(string $format): ImageDriver { + ob_start(); + switch (strtolower($format)) { case 'jpg': case 'jpeg': @@ -698,6 +700,10 @@ public function format(string $format): ImageDriver throw UnsupportedImageFormat::make($format); } + $this->image = imagecreatefromstring(ob_get_contents()); + + ob_end_clean(); + return $this; } }