From 69827106cb2f23ff891096026c0d73e595684423 Mon Sep 17 00:00:00 2001 From: vital Date: Fri, 27 Mar 2026 18:54:31 +0300 Subject: [PATCH] Remove deprecated imagedestroy calls for PHP 8.5 compatibility --- src/Captcha.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Captcha.php b/src/Captcha.php index f57286e..f0926d4 100644 --- a/src/Captcha.php +++ b/src/Captcha.php @@ -227,7 +227,6 @@ protected function applyWave($width, $height) } } - imagedestroy($this->image); $this->image = $img2; } @@ -237,7 +236,6 @@ public function output(): void header('Cache-Control: no-cache, no-store, must-revalidate'); header('Content-Type: image/png'); imagepng($this->image); - imagedestroy($this->image); } public function getBase64(): string @@ -246,7 +244,6 @@ public function getBase64(): string ob_start(); imagepng($this->image); $data = ob_get_clean(); - imagedestroy($this->image); return 'data:image/png;base64,' . base64_encode($data); } @@ -254,7 +251,6 @@ public function save(string $path): bool { if (!isset($this->image)) throw new Exception("Image not created."); $result = imagepng($this->image, $path); - imagedestroy($this->image); return $result; } -} +} \ No newline at end of file