소스 검색

:octocat: PHP 8.5 deprecation: imagedestroy()

smiley 1 개월 전
부모
커밋
bc7ba5e22a
2개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 0 1
      examples/imageWithText.php
  2. 1 2
      src/Output/QRGdImage.php

+ 0 - 1
examples/imageWithText.php

@@ -75,7 +75,6 @@ class QRImageWithText extends QRGdImagePNG{
 
 		// copy over the qrcode
 		imagecopymerge($this->image, $qrcode, 0, 0, 0, 0, $this->length, $this->length, 100);
-		imagedestroy($qrcode);
 
 		$fontColor = imagecolorallocate($this->image, ...$textColor);
 		$w         = imagefontwidth($textSize);

+ 1 - 2
src/Output/QRGdImage.php

@@ -17,7 +17,7 @@ use chillerlan\Settings\SettingsContainerInterface;
 use ErrorException;
 use Throwable;
 use function array_values, count, extension_loaded, imagebmp, imagecolorallocate, imagecolortransparent,
-	imagecreatetruecolor, imagedestroy, imagefilledellipse, imagefilledrectangle, imagegif, imagejpeg, imagepng,
+	imagecreatetruecolor, imagefilledellipse, imagefilledrectangle, imagegif, imagejpeg, imagepng,
 	imagescale, imagetypes, imagewebp, intdiv, intval, is_array, is_numeric, max, min, ob_end_clean, ob_get_contents, ob_start,
 	restore_error_handler, set_error_handler, sprintf;
 use const IMG_BMP, IMG_GIF, IMG_JPG, IMG_PNG, IMG_WEBP;
@@ -378,7 +378,6 @@ class QRGdImage extends QROutputAbstract{
 			$this->renderImage();
 
 			$imageData = ob_get_contents();
-			imagedestroy($this->image);
 		}
 		// not going to cover edge cases
 		// @codeCoverageIgnoreStart