No Code Attached Yet
avatar travisrisner
travisrisner
10 Apr 2025

Steps to reproduce the issue

  1. Go to System -> Plugins and enable the plugin Media - Action - Resize (if not enabled)
  2. In the plugin settings, set "Maximum Width" to 1920. Leave "Maximum Height" empty.
  3. Upload an image that is only 200px wide and any height (e.g., 300px) via the Media Manager.
  4. Look at the dimensions for the uploaded image

Expected result

The uploaded image should not be resized, because its width is already less than the maximum width set (1920px). The height constraint was left unset and should not affect resizing.

Actual result

The image is resized unnecessarily, despite already being within the maximum width constraint. This is because the resize plugin checks both width and height, and treats an unset height as 0, which breaks the logic.

System information (as much as possible)

  • Joomla version: 4.x / 5.x
  • PHP version: 8.x
  • Browser: Any
  • Media Action - Resize plugin enabled with only batch width set

Additional comments

This happens due to these lines from the plugin

When batch_height is not set (and thus 0), the image’s height comparison fails and causes the resize to proceed anyway. I can submit a PR to resolve this.

avatar travisrisner travisrisner - open - 10 Apr 2025
avatar joomla-cms-bot joomla-cms-bot - change - 10 Apr 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 Apr 2025
avatar fgsw
fgsw - comment - 10 Apr 2025

@travisrisner Please read #44862.

avatar travisrisner
travisrisner - comment - 10 Apr 2025

I see, thanks!

avatar travisrisner travisrisner - change - 10 Apr 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-04-10 13:15:20
Closed_By travisrisner
avatar travisrisner travisrisner - close - 10 Apr 2025

Add a Comment

Login with GitHub to post a comment