Skip to content

Conversation

@heelc29
Copy link
Contributor

@heelc29 heelc29 commented Oct 1, 2025

Summary of Changes

remove no longer needed imagedestroy()

In the migration of various extensions from resources to objects, a number of functions to close or free the resources became no-ops
imagedestroy() since the ext/gd migration in PHP 8.0

https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_imagedestroy

Image::destroy() can be deprecated in future Joomla version (eg. 6.1)

Testing Instructions

Create scheduled task Image Size Check with manual execution and limit of eg. 50px

  • enable max error reporting
  • use php 8.5 (latest pre-version 8.5.0rc1)

Run task

Actual result BEFORE applying this Pull Request

Task status: Terminated
deprecation message (possibly further)
image

Expected result AFTER applying this Pull Request

Task status: Completed
no deprecation message about imagedestroy()

Link to documentations

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed

Co-Authored-By: Quy Ton <[email protected]>
@HLeithner HLeithner added the bug label Oct 4, 2025
@Fedik Fedik added the PHP 8.x PHP 8.x deprecated issues label Oct 16, 2025
@richard67 richard67 dismissed HLeithner’s stale review October 16, 2025 17:17

The requested change has been implemented.

@muhme
Copy link
Contributor

muhme commented Oct 17, 2025

✅ Tested with JBT php8.5-rc

  • Before the PR with 'Image Size Check' Scheduled Task seen PHP warning Function imagedestroy() is deprecated and task failed with JSON.parse: unexpected character at line 1 column 1 of the JSON data
  • Applied patch with patchtester
    • ✅ no more Function imagedestroy() is deprecated
    • ✅ Scheduled Task 'Image Size Check' runs successful and one more image is reduced in size
  • Switched to PHP 8.1
    • ✅ Scheduled Task 'Image Size Check' runs successful and one more image is reduced in size

@muhme muhme merged commit 3244f2a into joomla:5.4-dev Oct 17, 2025
40 checks passed
@muhme muhme added this to the Joomla! 5.4.1 milestone Oct 17, 2025
@muhme
Copy link
Contributor

muhme commented Oct 17, 2025

Thank you @heelc29 for your contribution. Thank you @QuyTon and @HLeithner for your code reviews.

@heelc29 heelc29 deleted the 5.4/php85/gd branch November 1, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants