Skip to content

Refactor the SvgImageWidget class to work with Drupal 10.2+

Changes:

  • Have SvgImageWidget extend ImageWidget instead of FileWidget reducing code duplication manyfold.
  • Simplify the svg_image_get_image_file_dimensions() function a whole lot, it should not need to worry about non-svg images.
  • Add a FileIsImageOrSvg constraint, so that the FileIsImage validation can be kept even if the graphics toolkit (gd in most cases) does not think that svgs are images.

Closes #3413668

Merge request reports