mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
GD imagedestroy() is deprected and noop since PHP version 8.0
This commit is contained in:
@@ -63,10 +63,13 @@ class PhotoGd extends PhotoDriver {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GD imagedestroy() is deprected and noop since PHP version 8.0
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function destroy() {
|
||||
if($this->is_valid()) {
|
||||
imagedestroy($this->image);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,8 +98,6 @@ class PhotoGd extends PhotoDriver {
|
||||
imagefill($dest, 0, 0, imagecolorallocatealpha($dest, 0, 0, 0, 127)); // fill with alpha
|
||||
|
||||
imagecopyresampled($dest, $this->image, 0, 0, 0, 0, $dest_width, $dest_height, $width, $height);
|
||||
if($this->image)
|
||||
imagedestroy($this->image);
|
||||
|
||||
$this->image = $dest;
|
||||
$this->setDimensions();
|
||||
@@ -142,8 +143,6 @@ class PhotoGd extends PhotoDriver {
|
||||
imagefill($dest, 0, 0, imagecolorallocatealpha($dest, 0, 0, 0, 127)); // fill with alpha
|
||||
|
||||
imagecopyresampled($dest, $this->image, 0, 0, $x, $y, $maxx, $maxy, $w, $h);
|
||||
if($this->image)
|
||||
imagedestroy($this->image);
|
||||
|
||||
$this->image = $dest;
|
||||
$this->setDimensions();
|
||||
|
||||
@@ -54,9 +54,6 @@ class Epubthumb {
|
||||
imagecopyresampled($dest, $image, 0, 0, 0, 0, $width, $height, $srcwidth, $srcheight);
|
||||
|
||||
imagejpeg($dest, "{$file}.thumb");
|
||||
|
||||
imagedestroy($image);
|
||||
imagedestroy($dest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ class Mp3audio {
|
||||
imagealphablending($dest, false);
|
||||
imagesavealpha($dest, true);
|
||||
imagecopyresampled($dest, $image, 0, 0, 0, 0, $width, $height, $srcwidth, $srcheight);
|
||||
imagedestroy($image);
|
||||
imagejpeg($dest,dbunescbin($attach['content']) . '.thumb');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +29,11 @@ class PhotodriverTest extends UnitTestCase {
|
||||
case 'png':
|
||||
$im = imagecreatetruecolor(10, 10);
|
||||
imagepng($im, $tmp);
|
||||
imagedestroy($im);
|
||||
break;
|
||||
case 'jpeg':
|
||||
default:
|
||||
$im = imagecreatetruecolor(10, 10);
|
||||
imagejpeg($im, $tmp);
|
||||
imagedestroy($im);
|
||||
break;
|
||||
}
|
||||
return $tmp;
|
||||
|
||||
Reference in New Issue
Block a user