Problem/Motivation

Acquia DAM module is rendering SVG images with zero-value width and height attributes, causing them to not display on the front end. Previously, these attributes were not included at all. The customer has confirmed they are not overriding the default module template, which suggests a regression in the module's behavior. This issue is impacting multiple components on the site and is considered a high-priority problem.

Issue fork acquia_dam-3548840

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

rajeshreeputra created an issue. See original summary.

rajeshreeputra’s picture

Status: Active » Needs review

Change to Image Dimension Handling:

  • The getImageDimensions method no longer immediately returns image property dimensions if found. Instead, it now applies additional logic for original image formats.
  • There is no behavioral change for non-original image styles—dimension retrieval via image style configuration remains unchanged.

Note:
In the DAM API, the width and height values in image_properties are always 0 for SVG formats:

"file_properties": {
  "format": "SVG",
  "format_type": "image",
  "size_in_kbytes": 0,
  "size_in_bytes": 334,
  "image_properties": {
    "width": 0.0,
    "height": 0.0,
    "aspect_ratio": 0.0
  },
  "video_properties": null
}

Recommendation:
To correctly render SVG images, always use an image style other than original for SVG files.

Requesting early review.

ankitv18’s picture

Status: Needs review » Needs work

As per the comment on the MR by @vishal I agree with him, hence moving back into NW.

rajeshreeputra’s picture

Status: Needs work » Needs review

Requesting review.

japerry’s picture

Status: Needs review » Needs work

If you end up using original though, you can just not specify a width and height. The code now looks like it'd return null as values on there, which I think isn't what we want.. unless the template or something else interprets that and unsets the key to be included in the embed code.

japerry’s picture

rajeshreeputra’s picture

Status: Needs work » Needs review

Requesting review.

japerry’s picture

Status: Needs review » Needs work

It appears the changes were not tested. Marking NW, It'd be good to verify an SVG is getting the correct embed code.

rajeshreeputra’s picture

Status: Needs work » Needs review

Fixed failing test, requesting review.

japerry’s picture

Status: Needs review » Fixed

Looks good. Merged!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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