[wp-trac] [WordPress Trac] #62530: Inline SVG Images Cannot Be Sized

WordPress Trac noreply at wordpress.org
Wed Nov 27 21:15:24 UTC 2024


#62530: Inline SVG Images Cannot Be Sized
--------------------------+------------------------------
 Reporter:  timsinclair   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  6.7.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------

Comment (by timsinclair):

 Hello @rinkalpagdar

 Interesting ... The reason your hotel svg works and mine does not is
 because when you uploaded your svg to your installation, the attachment
 metadata in the database was updated to include the width of the svg. I'm
 guessing you are using a plugin to enable svg uploads like SVG Support
 (https://wordpress.org/plugins/svg-support/) which does this automatically
 when the svg is uploaded. In my case, I was just enabling svg's to be
 uploaded by enabling the svg mimetype, which resulted in the svg being
 uploaded to the media library but without any width metadata associated
 with it. Once I manually added an arbitrary width to the attachment
 metadata in the database, my svg worked as expected and was resizeable.

 This does not explain why the svg sizing works in previous versions of
 WordPress (6.6) without the width metadata in the database, and I do still
 believe this is a bug since the application of an inline css width
 attribute via javascript in the editor environment should not depend on
 the presence of the width metadata in the database.

 If you would like to investigate this further, I recommend removing the
 width and height metadata for the hotel svg attachment from the database
 and then attempt to place the svg again. This will result in the svg not
 being resizeable.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62530#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list