No Code Attached Yet
avatar mojeweb
mojeweb
11 Feb 2025

Steps to reproduce the issue

  1. In the plugin Media Action - Resize set the maximum image width to 1200px.
  2. Upload an 800px, ca 30kb image in the media manager.

Expected result

Image should be 800px and not more than 30kb.

Actual result

Image is 1200px and at least double the size.

System information (as much as possible)

Joomla 4 and 5 latest, PHP 8.2

avatar mojeweb mojeweb - open - 11 Feb 2025
avatar joomla-cms-bot joomla-cms-bot - change - 11 Feb 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Feb 2025
avatar fgsw
fgsw - comment - 12 Feb 2025

@mojeweb The settings are for server side actions when images are created:

Image

avatar QuyTon QuyTon - close - 13 Feb 2025
avatar QuyTon
QuyTon - comment - 13 Feb 2025

@mojeweb This is the expected behavior. Values in the Resize plugin will be applied to all uploaded images.

avatar QuyTon QuyTon - change - 13 Feb 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-02-13 16:48:08
Closed_By QuyTon
avatar mojeweb
mojeweb - comment - 13 Feb 2025

@mojeweb This is the expected behavior. Values in the Resize plugin will be applied to all uploaded images.

So Image Max Width means in fact not max width but exact width?
I realy dont get that logic. Image should be max that entered width. And smaller on size in kb.

avatar QuyTon
QuyTon - comment - 13 Feb 2025

It will only be resized if the image's width/height are greater than the maximum values.
What are your resize maximum height/width values?
What are the width/height values of your image?

avatar travisrisner
travisrisner - comment - 10 Apr 2025

I really think this issue needs to be reopened. While yes, it might be expected behavior, it should not require that both a width and height have to be set so statically, it is called a "Max Width" isn't it? I should be able to set just a width and not have to worry about uploading an image smaller than that width being bumped up to the "max width". I am prepared to make a pull request to fix this, as it's a simple fix in the plugin.

avatar travisrisner
travisrisner - comment - 10 Apr 2025

Pull request submitted. Just to reiterate, the real issue here is that it expects BOTH and doesn't give you the flexibility of just specifying one.

If this doesn't get reopened and the PR is unacceptable, then I strongly feel that both of these form fields need required attributes added to ensure users know they HAVE to specify both.

avatar QuyTon
QuyTon - comment - 10 Apr 2025

There is no need to reopen the issue once there is a PR for it. It can be reopened if the PR is not accepted. Thank you for your contribution!

avatar mojeweb
mojeweb - comment - 10 Apr 2025

It will only be resized if the image's width/height are greater than the maximum values. What are your resize maximum height/width values? What are the width/height values of your image?

Please read again my first post. Uploaded image is LARGER than original uploaded. The image thus ENLARGES after uploading.

avatar QuyTon
QuyTon - comment - 14 Apr 2025

@mojeweb Please test PR #45311.

avatar mojeweb
mojeweb - comment - 18 Apr 2025

@mojeweb Please test PR #45311.

Will this fix be included with Joomla 4 to?

avatar travisrisner
travisrisner - comment - 18 Apr 2025

@mojeweb Please test PR #45311.

Will this fix be included with Joomla 4 to?

I originally opened #45309 to deal with Joomla 4, but apparently 4 is only getting security updates at this time. Seems silly to me not to at least allow bug fixes too, as its not like its introducing new features. I'm proably going to write a free plugin for 4 that works the same way, because I have some websites on 4 that will be upgrading to 5 sometime before October. I'd like to at least be able to utilize this feature for them at the moment.

avatar mojeweb
mojeweb - comment - 18 Apr 2025

@mojeweb Please test PR #45311.

Nice. So I have J4 and stuck with bug with no solution. How can I test on J4?

avatar travisrisner
travisrisner - comment - 18 Apr 2025

@mojeweb Please test PR #45311.

Nice. So I have J4 and stuck with bug with no solution. How can I test on J4?

As I have a similar need as you, I went ahead and set up a plugin that should resolve the issue for J4. Can find that at https://github.com/travisrisner/plg_media-action_resizefix.

There are some instructions on the readme, but essentially just download the zip and install it like you would a normal extension. From there go to your plugins list and search for media action, find the one named Media Action - Resize (J4 Bug Fix) and enable it, configure it to your needs. Optionally (but recommended), yo ucan disable the core plugin named Media Action - Resize.

Add a Comment

Login with GitHub to post a comment