Skip to content

Conversation

@Pixelao
Copy link
Contributor

@Pixelao Pixelao commented Dec 30, 2025

Summary

This PR removes all imagedestroy() calls from the GD image generation logic.

Since the project only supports PHP ≥ 8.2, GD images are objects and calling imagedestroy() has no effect and is deprecated.

Changes included

  • Removed all imagedestroy() calls
  • Avoided deprecated and no-op behavior on PHP 8+

Motivation

imagedestroy() has been deprecated since PHP 8.5 and has no effect since PHP 8.0. Removing it aligns the codebase with the supported PHP versions and avoids deprecation warnings while keeping the code clean and forward-compatible.

Detected deprecation messages:

/var/www/app.dev/vendor/picqer/php-barcode-generator/src/Renderers/PngRenderer.php:151 Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0
/var/www/app.dev/vendor/picqer/php-barcode-generator/src/Renderers/JpgRenderer.php:28 Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0

@casperbakker
Copy link
Member

Thanks. But as we only support after PHP 8.2, the call can be removed completely. No need to do the version check. Can you update that?

@Pixelao
Copy link
Contributor Author

Pixelao commented Jan 7, 2026

Hello @casperbakker! Good point, thanks. I’ve removed the imagedestroy() calls completely. 👍🏻

@casperbakker casperbakker merged commit 1b07d4f into picqer:main Jan 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants