Problem/Motivation

All images are converted to PNG format and resized to "Image size limit" set at the settings form.
Such behaviour is confusing a little bit.
I guess images should be downloaded in original format, not sized up to "Image size limit".

Steps to reproduce

  1. Install module and configure Acquia DAM module.
  2. Configure node to have a field where we can chose images for Acquia DAM.
  3. Add a new image to this field with any extension except png.
  4. Check that the image was converted to PNG format.
  5. At /admin/config/media/acquiadam set Image size limit to 2048px
  6. Add a new image from Acquia DAM with width and height less than 2048px
  7. Check that image was sized up and its height or width is 2048 px.
  8. As a result of such conversions image size in MB is increased in comparison to the original one.

Proposed resolution

I propose:

  1. adding an ability to configure whether we want to load original images or set "Image size limit" as it is now.
  2. adding configuration whether we allow to size images up if "Image size limit" is set not to "Original"

User interface changes

At /admin/config/media/acquiadam Acquia DAM configuration page in "Image size limit" is added an "Original" option.
At /admin/config/media/acquiadam Acquia DAM configuration page an "Allow size up" checkbox is added after "Image size limit" dropdown.
"Allow size up" checkbox depends on the value of "Image size limit" and is show only if "Image size limit" is not "Original"

CommentFileSizeAuthor
#5 3270539-4.patch8.05 KBlinichalexey
#2 3270539-2.patch5.06 KBlinichalexey

Comments

linichalexey created an issue. See original summary.

linichalexey’s picture

Title: All files are converted to png one and are resized. » All files are converted to png format and are resized.
Issue summary: View changes
StatusFileSize
new5.06 KB
linichalexey’s picture

Assigned: linichalexey » Unassigned
Status: Active » Needs review

Status: Needs review » Needs work

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

linichalexey’s picture

StatusFileSize
new8.05 KB

Added some fixes for file formats that do not have endpoints. And fixed tests.

alexey samsonov’s picture

As I can see, there was a PR that removed an option to download assets with original format: https://git.drupalcode.org/project/media_acquiadam/-/commit/62cbac5fa6c1...
Probably we should get an explanation from maintainers what was the reason...

alexey samsonov’s picture

btw, applied patch and can confirm that it works as expected. Images can now be downloaded in original format/size. I also tried to manually sync all previously downloaded images and all of them were updated with original format/size.
Thanks

barrett’s picture

This should really be split into two issues. One, the conversion of image assets to PNG, was a deliberate choice made in the module. Adding an ability to control that would be a feature request. The other, the upsizing of assets, is a bug.

kevinquillen’s picture

I applied this patch and modified it to accept SVG extensions. While it appears to not rewrite it to PNG now, all that displays is the Widen.png logo for the thumbnail and on the page.

You need to install the ImageMagick module to leverage the ImageMagick image toolkit to make use of SVG in this case since GD does not support it. I did not realize that.

After that, SVGs from the DAM started appearing in the site without being converted to PNG.

barrett’s picture

@japerry, @mglaman, I think this was resolved in the 2.0.1 release. Can you confirm?

japerry’s picture

Status: Needs work » Fixed

Yup, sure was!

Status: Fixed » Closed (fixed)

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