Skip to content

Commit 3244f2a

Browse files
heelc29QuyTonHLeithner
authored
[5.4][PHP8.5] imagedestroy() function has been deprecated (joomla#46200)
--------- Co-authored-by: Quy Ton <[email protected]> Co-authored-by: Harald Leithner <[email protected]>
1 parent 446b596 commit 3244f2a

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

libraries/src/Image/Filter/Backgroundfill.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ public function execute(array $options = [])
7171
// Move flattened result onto current handle.
7272
// If handle was palette-based, it'll stay like that.
7373
imagecopy($this->handle, $bg, 0, 0, 0, 0, $width, $height);
74-
75-
// Free up memory
76-
imagedestroy($bg);
7774
}
7875

7976
/**

libraries/src/Image/Image.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,9 @@ protected function sanitizeWidth($width, $height)
11421142
public function destroy()
11431143
{
11441144
if ($this->isLoaded()) {
1145-
return imagedestroy($this->getHandle());
1145+
$this->handle = null;
1146+
1147+
return true;
11461148
}
11471149

11481150
return false;

tests/Unit/Plugin/Task/Checkfiles/Extension/CheckfilesPluginTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public function setUp(): void
5959
$image = imagecreate(200, 200);
6060
imagecolorallocate($image, 255, 255, 0);
6161
imagepng($image, $this->tmpFolder . '/test.png');
62-
imagedestroy($image);
6362
}
6463

6564
/**

0 commit comments

Comments
 (0)