Problem/Motivation

This issue is being split from the initial report in https://www.drupal.org/project/media_acquiadam/issues/3270539, which combined this issue and a separate image conversion issue.

Images which are in the DAM with a smaller image size are up-sized by the module to Image Size Limit setting in the configuration form, rather being loaded in their original size. This was not the intent of the module.

Steps to reproduce

  1. Install and configure the module.
  2. Select an image asset from the DAM which is smaller that the configured max image size in the module's config form.
  3. Observe the image is upsized to the configured parameter.

Proposed resolution

When retrieving an image, check the sizes of the source image and take the smallest of a) the configured size limit, b) the size of the largest dimension of the image.

Remaining tasks

Tests needed

User interface changes

Changed text in the description of the size limit field in the config form to be more clear.

API changes

N/A

Data model changes

N/A

CommentFileSizeAuthor
#2 upsize.patch2.31 KBbarrett
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Barrett created an issue. See original summary.

barrett’s picture

StatusFileSize
new2.31 KB
barrett’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: upsize.patch, failed testing. View results

mglaman made their first commit to this issue’s fork.

mglaman’s picture

Status: Needs work » Needs review

Fixed tests

mglaman’s picture

cainaru’s picture

Status: Needs review » Reviewed & tested by the community

Both me and @Barrett tested this patch. I tested using a 65x65 asset from the DAM and have successfully verified that it is no longer being upscaled to the configured size in the module's "Image Size Limit" (the 65x65 test asset remains its original size). I've also verified that images that are larger than the configured size in the module's "Image Size Limit" are still scaled down to the configured image size limit as expected.

+1 this looks good to me

  • mglaman committed ff0818e on 2.x
    Issue #3274796 by Barrett: Small assets are up-sized to configured max...
mglaman’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for confirming, merged.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.