Could not apply XXX image style to public://images/XXX.svg because the style does not support it.

Created on 13 November 2017, over 7 years ago
Updated 28 November 2023, over 1 year ago

I did a Drush flush image styles

In logs I now get:

Could not apply XXX image style to public://images/XXX.svg because the style does not support it.

And all my sgv Image are now not being rendered in Display Suite.

πŸ› Bug report
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Rar9

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States jrb Raleigh-Durham Area, NC, USA

    We're seeing this, too. In our case, we've got:

    1. A Paragraph type that includes an entity reference field to a Media entity (image).
    2. The image field on the Media entity allows the following extensions: png, gif, jpg, jpeg, svg
    3. The display of the Paragraph type uses the "Thumbnail" format with an image style.

    When a node that includes an instance of this Paragraph type is viewed, the SVG is correctly shown, but we get a warning like this in the logs:

    Could not apply XXX image style to public://my-icon.svg because the style does not support it.

    Heh. Just noticed that this issue is 6+ years old!

  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States jrb Raleigh-Durham Area, NC, USA

    Looking at the code in image.module, it calls $style->supportsUri($variables['uri']) to see if the image type is supported. If not, it just returns the original image then logs the warning. Given that the image is displaying, I don't think there's anything this module can do about it.

    Work on this warning was in #2652138: Image styles do not play nicely with SVGs β†’ . Would be nice to suppress this warning so it doesn't fill up the logs, but I don't think that's this module's problem.

Production build 0.71.5 2024