Intervention / image

PHP Image Processing
https://image.intervention.io
MIT License
13.92k stars 1.5k forks source link

`destroy()` function not necessary anymore or just missing in v3? #1273

Closed chescos closed 9 months ago

chescos commented 9 months ago

v2 had the destroy() function which could free up memory associated with the image instance before the PHP script ended. Is this not necessary anymore for some reason, or just currently not possible with v3?

olivervogel commented 9 months ago

Intervention Image is a wrapper providing a unified API for GD and Imagick Library. The library is therefore dependent on the functions provided by the extensions.

GD Library's imagedestroy() no longer has an effect since PHP 8, so I have decided to remove support.

I would suggest just trying to set the image variable to null or use unset() to free memory.

cheack commented 9 months ago

@olivervogel I think it makes sense to mention it in the upgrade manual (https://image.intervention.io/v3/introduction/upgrade).

olivervogel commented 9 months ago

I think it makes sense to mention it in the upgrade manual (https://image.intervention.io/v3/introduction/upgrade).

You're right. I will accept pull requests: https://github.com/Intervention/docs