Needs work
Project:
Drupal core
Version:
main
Component:
image.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2019 at 10:15 UTC
Updated:
22 Jul 2026 at 09:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
a.boutakaoua commentedComment #3
a.boutakaoua commentedComment #5
nelslynn commentedUsing Drupal 8.8.2, this patch produces this error:
Comment #7
phenaproximaI think this is out of the media system's scope; core's image handling doesn't really support SVGs, so I'm moving this into that component.
Comment #8
akalam commentedThe patch assumes the media entity has a field called "field_media_image" and can not be the case.
Comment #9
feuerwagenAs the available patch only handles a very specific case with a media entity and not the root problem in the image module, setting to needs work.
Comment #10
feuerwagen#2652138 apparently only fixed the image module trying to apply an image style to SVGs (and sometimes failing in nasty ways) but didn't make sure that SVGs are still displayed.
Comment #13
vipin.mittal18This patch won't work as it is specifically for field_media_image field.
I still not figured out any alternative for this but there is a way from manage display, how we wan't SVG to be render without applying image style.
Comment #15
Thangaraj MoorthiMy drupal version is 9.4.8
The given patch (https://www.drupal.org/files/issues/2019-11-01/media_library_not_render_...) is not working for me.
Is there any fix to doing image style for the svg format ?
This is the error I'm facing,
Image scale and crop failed using the gd toolkit on public://2022-11/banner_01.svg (image/svg+xml, 2500x1178)Comment #17
kolesnikoff commentedReroll the patch for Drupal 9.5.9.
Comment #18
avpadernoComment #19
smustgrave commentedThe issue summary could use some updating.
Also as a bug will need a test case.
Have you checked out https://www.drupal.org/project/svg_image
Comment #21
simeonkesmev commentedChange to the patch avoiding hardcoded file names and fixing deprecated functiontion call
Comment #22
_utsavsharma commentedFixed failures in #21.
Comment #23
avpadernoTests have not been added.
Comment #25
fwustComment #26
guicom commentedUpdate patch for Drupal 10.3.x
Comment #27
jennypanighetti commentedI'm still having issues with this in 10.4, but I'm not getting any errors and the patch applies, so I don't know where to go from here.
PNGs I use display fine, but SVGs are showing as 0x0, even though they have the image width and height set in the HTML. I have to specify a width in the CSS to get it to show; max-width and width:auto are not enough.
Comment #28
avpadernoComment #29
dewancodes commentedImage styles are not generating images for svg types even on Drupal 11.2
It says "Error generating image.".
/sites/default/files/styles/left_right_content_image_tags_650x550/public/2025-10/16-oct-StandardizeMembership-With-a-Universal-Workflow--svgg.svg?itok=NyDM9Yij
Comment #30
ironnuts commentedApplied IS template to the IS, re-structured the IS with minimal deletions and re-writing for clarity.
Comment #31
mayurgajar commentedComment #33
mayurgajar commentedMR: https://git.drupalcode.org/project/drupal/-/merge_requests/14003
It still need to fix phpstan issues
------ -----------------------------------------------------------------------
Line core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailForm
atter.php
------ -----------------------------------------------------------------------
223 Method
Drupal\media\Plugin\Field\FieldFormatter\MediaThumbnailFormatter::ren
derSvgTheme() has no return type specified.
🪪 missingType.return
------ -----------------------------------------------------------------------
Comment #37
sophie.skRerolled the patch against Drupal 11.4.4: https://git.drupalcode.org/project/drupal/-/merge_requests/16388
Comment #38
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.