avatar particthistle
18 Apr 2021

Steps to reproduce the issue

  • Systems > Site Templates > Open template containing the image
  • Select an image
  • Click on resize to resize an image

Expected result

Resize Image modal should have an option to keep the image resized proportionally.

Actual result

Currently there's no option to keep the resize proportional, so users need to manually calculate the proportions to keep the image the correct size :(

Additional comments

Discovered while testing #33087

avatar particthistle particthistle - open - 18 Apr 2021
avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Apr 2021
avatar ReLater
ReLater - comment - 18 Apr 2021

Confirmed: Browser blocks sending when not both fields are filled.

Just BTW: I tried to enter 0 for the height to test if it's then resized proportionally depending on the width. I get an absolutely not helpful Joomla error message (alert) "No valid image was loaded." after page has reloaded.

avatar PhilETaylor
PhilETaylor - comment - 18 Apr 2021

Here is a fun bug for you.. used the 0/90/180/270 buttons on the media rotate page, and the image magically changes dimensions... but when you save it magically jumps back to the original dimensions, but rotated... Just one of many issues with the Javascript based media manager.

avatar dgrammatiko
dgrammatiko - comment - 18 Apr 2021

@PhilETaylor some of the reported issues should be fixed with #33192

avatar PhilETaylor
PhilETaylor - comment - 18 Apr 2021

I'll take a look as soon as my back pain allows extended time at a desk. Thanks.

avatar ReLater
ReLater - comment - 18 Apr 2021

For this issue the main problem seems to be that administrator\components\com_templates\src\Model\TemplateModel.php::resizeImage() uses a hard coded Image::SCALE_FILL. That's a scale method that needs a defined height AND width.

As a model method it should be more flexible.

I think the more popular/more often expected scale methods would be

  • Image::SCALE_INSIDE (The larger h or w decides. The other is adjusted. Ratio is retained.). That's the default scale constant of Joomla\CMS\Image\Image::resize().
  • maybe sometimes Image::SCALE_OUTSIDE (Care is taken that w or h is not undercut. Ratio is retained.).

Add a Comment

Login with GitHub to post a comment