Archived topic
Error debug shows that can't get Width and Height after uploading SVG logo.
5 replies · Started by fastview on July 20, 2022
Hello.
This site https://toohotissue.com/ shows logo after uploading svg files.
Browser does work.
* refer 1 : https://toohotissue.com/attach1.jpg
however, it cannot get width and height array key in error debug messgage.
* refer 2 : https://toohotissue.com/attach2.jpg
* Error debug message : hidden area text
In chrome dev tools, there is no width and height array key in img tag
* Refer3 : https://toohotissue.com/attach3.jpg
is there way to get width and height array key in SVG logo?
Hello there,
For a fix, see David’s response here: https://generatepress.com/forums/topic/image-elements-do-not-have-explicit-width-and-height-7/#post-1962439:~:text=9%3A48%20am-,%231962439,-EDIT%20%7C%20MOVE
Kindly let us know how it goes.
I am using this snippet in that page.
: https://generatepress.com/forums/topic/svg-logo-image-dimensions-incorrect-causes-layout-shift/
but it doesn't work.
Could you please check it if you have wp admin account?
you can check code snippet in this page
: hidden area text
Can you try installing Safe SVG, and then import the SVG file again?: https://wordpress.org/plugins/safe-svg/
If that doesn’t work, try adding width and height manually to your SVG. Example: https://stackoverflow.com/questions/21368410/how-to-set-svg-width-and-svg-height-by-percent
Let us know how it goes.
I solved it by installing Safe SVG.
Thank you Fernando!
You’re welcome! Glad that worked!