Skip to content

Commit d0e221b

Browse files
authored
Stop calling imagedestroy in PHP8+
1 parent facddd9 commit d0e221b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

getid3/module.graphic.bmp.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,12 +676,16 @@ public function PlotBMP(&$BMPinfo) {
676676
}
677677
if (headers_sent()) {
678678
echo 'plotted '.($BMPinfo['resolution_x'] * $BMPinfo['resolution_y']).' pixels in '.(time() - $starttime).' seconds<BR>';
679-
imagedestroy($im);
679+
if (PHP_VERSION_ID < 80000) { // imagedestroy does nothing after PHP8 and give deprecation warnings in PHP8.5
680+
imagedestroy($im);
681+
}
680682
exit;
681683
} else {
682684
header('Content-type: image/png');
683685
imagepng($im);
684-
imagedestroy($im);
686+
if (PHP_VERSION_ID < 80000) {
687+
imagedestroy($im);
688+
}
685689
return true;
686690
}
687691
}

0 commit comments

Comments
 (0)