PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar travisrisner
travisrisner
10 Apr 2025

Pull Request for Issue #44862

Summary of Changes

This pull request resolves a bug in the Media Action - Resize plugin where images are resized unnecessarily when only one dimension (width or height) is set.

Previously, if a user defined only a max width (e.g., 1920px) and left height unset, the plugin would still resize small images (e.g., 200px wide). This occurred because the height check defaulted to 0, incorrectly failing the comparison logic.

The logic has been updated to evaluate width and height independently. The plugin now only resizes if the image exceeds a defined constraint.

Testing Instructions

  1. Enable the plugin Media Action - Resize.
  2. Set Maximum Width to 1920. Leave Maximum Height empty.
  3. Upload a small image via Media Manager (e.g., 200x300px).
  4. Observe that before the patch, the image was resized unnecessarily.
  5. Observe that after the patch, the image is not resized if not necessary.
  6. Optionally test with only height set and both width and height set.

Actual result BEFORE applying this Pull Request

Images smaller than the defined max width or height are still resized if one constraint is not set.

Expected result AFTER applying this Pull Request

Images are only resized if they exceed a defined max width or height. Unset dimensions are ignored in the check, preventing unnecessary resizing.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org:
  • No documentation changes for manual.joomla.org needed
avatar travisrisner travisrisner - open - 10 Apr 2025
avatar travisrisner travisrisner - change - 10 Apr 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Apr 2025
Category Front End Plugins
avatar brianteeman
brianteeman - comment - 10 Apr 2025

Please can you rebase this to 5.3 as there wont be any further releases of 5.2

avatar travisrisner travisrisner - change - 10 Apr 2025
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2025-04-10 14:11:16
Closed_By travisrisner
Labels Added: PR-5.2-dev
avatar travisrisner travisrisner - close - 10 Apr 2025

Add a Comment

Login with GitHub to post a comment