Support » Plugin: SVG Support » image attributes width and height 1 added

  • On our site the svg logo is currently not showing because inline width and height 1 are added for some reason. We did not have this issue before.

    
    <img width="1" height="1" src="https://site.com/wp-content/uploads/2021/09/Our-Company-Logo-w-tag.svg" class="custom-logo" alt="Company Name - discover together">
    

    Any ideas whether this plugin is adding these image attributes?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Rhand

    (@rhand)

    I reverted to Version 2.3.21 and it seems to be working well again. But will do some more testing locally.

    Thread Starter Rhand

    (@rhand)

    Local testing with advanced options turned on and enforcing inline SVG does work. Image loads now using

    
    <svg version="1.1" id="" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewBox="0 0 1389.4 771.3" xml:space="preserve" class="custom-logo style-svg replaced-svg svg-replaced-0"><style>.st0{fill:none}.st1{fill:#5628e2}</style><path class="st0" d="M744.5 141.8c-8.7-9.2-19.9-13.8-33.7-13.8-13.8 0-25 4.6-33.5 13.8-8.5 9.2-12.8 20.9-12.8 35 0 14.1 4.3 25.8 13 35 8.4 9.2 19.5 13.8 33.3 13.8 13.8 0 25.1-4.6 33.7-13.8 8.7-9.2 13-20.9 13-35 0-14.2-4.3-25.8-13-35zM753.7 395.8l-8.4-4.8v12.4c2.6-2.8 5.4-5.4 8.4-7.6zM76.5 211.7c8.7 9.2 19.9 13.8 33.7 13.8 13.8 0 25-4.6 33.5-13.8 8.5-9.2 12.8-20.9 12.8-35 0-14.1-4.3-25.7-12.8-35-.5-.6-1.1-1.1-1.6-1.6-23.3 2-46.7 4.3-69.9 6.8-5.8 8.3-8.8 18.2-8.8 29.8.1 14.1 4.5 25.8 13.1 35z"></path><path class="st0" d="M110.3 127.9c-13.8 0-25.1 4.6-33.7 13.8-1.6 1.7-3 3.4-4.2 5.2 23.3-2.5 46.6-4.8 69.9-6.8-8.4-8.1-19-12.2-32-12.2zM1158.5 432.7c-7.2-7-16.5-10.6-27.8-10.6s-20.9 3.5-28.5 10.4c-7.6 6.9-12.6 16.3-15 28.3h85.8c-2.5-11.7-7.3-21.1-14.5-28.1zM464 221c7.9 6.2 16.5 9.4 26 9.4 7.5 0 14.4-2 20.6-5.9-19.1-13-38.5-25.2-58.4-36.2v1.4c0 14.7 3.9 25.1 11.8 31.3zM1102.6 522.3c8.4 7.2 18.4 10.8 30.1 10.8 17.8 0 31.7-5.6 41.6-16.7-28.2-2.9-56.2-6.4-84-10.8 2.9 6.6 7.1 12.2 12.3 16.7z"></path><path class="st1" d="m142.2 140.1 1.6 1.6c8.5 9.2 12.8 20.9 12.8 35 0 14.1-4.3 25.8-12.8 35s-19.7 13.8-33.5 13.8-25.1-4.6-33.7-13.8c-8.7-9.2-13-20.9-13-35 0-11.6 2.9-21.5 8.8-29.8-18.6 2-37.2 4.2-55.8 6.6-1.4 7.3-2.1 15-2.1 23.2 0 27.9 8.4 51 25.2 69.3 16.8 18.3 37.9 27.4 63.4 27.4 22.2 0 40.1-7.6 53.7-22.8v19.5h50.8V135.3c-12.4.7-24.8 1.5-37.2 2.5-9.5.7-18.8 1.5-28.2 2.3zM252.2 134.2v136.1H303v-85.8c0-20.1 6.6-34.8 19.9-44.2-.9-.2-1.7-.3-2.6-.5-22.5-3.9-45.3-5.4-68.1-5.6zM490 230.4c-9.5 0-18.2-3.1-26-9.4-7.9-6.2-11.8-16.7-11.8-31.3v-1.4c-16.6-9.2-33.5-17.5-50.8-24.7v34.2c0 26.3 7.2 45.5 21.8 57.5 14.5 12.1 31.6 18.1 51.4 18.1 22 0 39.3-6.8 52-20.3v17.1h47.2c-20.9-15.7-41.9-31.2-63.2-45.7-6.2 3.9-13.1 5.9-20.6 5.9zM407.4 400.8c-14.4-12.1-31.4-18.1-51.2-18.1-22.2 0-39.7 6.9-52.4 20.7v-95.1H253v264.3h50.8V466c0-14.6 3.8-25.1 11.4-31.3 7.6-6.2 16.1-9.4 25.6-9.4s18.1 3.1 25.8 9.4c7.7 6.2 11.6 16.7 11.6 31.3v106.5H429V458.3c0-26.3-7.2-45.5-21.6-57.5zM598.9 492c0 14.6-3.7 25.1-11.2 31.3-7.5 6.2-15.9 9.4-25.4 9.4-9.5 0-18.2-3.1-26-9.4-7.9-6.2-11.8-16.7-11.8-31.3V385.5h-50.8v114.7c0 26.3 7.2 45.5 21.8 57.5 14.5 12.1 31.6 18.1 51.4 18.1 22 0 39.3-6.8 52-20.3v17.1h50.8v-187h-50.8V492zM870.2 449.5c-40-15-78.9-32.7-116.5-53.7-3 2.2-5.8 4.8-8.4 7.6v-17.9h-50.8v187h50.8V466c0-14.6 3.8-25.1 11.4-31.3 7.6-6.2 16.1-9.4 25.6-9.4s18.1 3.1 25.8 9.4c7.7 6.2 11.6 16.7 11.6 31.3v106.5h50.8V458.3c0-3-.1-6-.3-8.8zM924.2 518.5c0 36.1 18.3 54.1 54.9 54.1h33.7v-39.4h-12.6c-3.8 0-6.8-.2-9.1-.6-2.3-.4-4.9-1.3-7.7-2.6-2.8-1.4-4.9-3.7-6.3-6.9-1.4-3.3-2-7.5-2-12.6v-28.1c-17.1-4.4-34-9.1-50.8-14.3v50.4zM1182.6 517.2l-5.6-4.1c-.9 1.1-1.8 2.2-2.7 3.2-9.9 11.1-23.8 16.7-41.6 16.7-11.7 0-21.7-3.6-30.1-10.8-5.3-4.5-9.4-10.1-12.3-16.7-17.3-2.7-34.4-5.7-51.5-9.1 3 20.5 11.4 37.9 25.2 52.4 17.6 18.4 40.5 27.6 68.7 27.6 16.8 0 32.1-3.4 45.9-10.2 13.8-6.8 24.8-16.1 32.9-28.1l-28.9-20.9zM1258.3 572.5h50.8v-47c-17-.6-33.9-1.4-50.8-2.4v49.4z"></path><g><path d="M156.6 6v97.2C143.1 88 125.2 80.4 103 80.4c-25.8 0-46.9 8.9-63.4 26.8-11.9 12.9-19.6 28.4-23.1 46.3 18.6-2.4 37.2-4.5 55.8-6.6 1.3-1.8 2.7-3.5 4.2-5.2 8.7-9.2 19.9-13.8 33.7-13.8 13 0 23.6 4.1 31.9 12.2 9.3-.8 18.7-1.6 28-2.3 12.4-1 24.8-1.8 37.2-2.5V6h-50.7zM368.9 80.4c-29 .5-51 12.7-65.9 36.6V83.2h-50.8v51c22.8.2 45.6 1.7 68.1 5.6.9.1 1.7.3 2.6.5 10.9-7.7 26.2-11.8 46-12.3V80.4zM577.4 83.2h-50.8v106.5c0 14.6-3.7 25.1-11.2 31.3-1.6 1.3-3.2 2.5-4.8 3.5 21.4 14.5 42.3 30 63.2 45.7h3.6v-187zM452.2 83.2h-50.8v80.5c17.4 7.2 34.3 15.5 50.8 24.7V83.2zM757.5 83.2v20.3c-13.3-15.4-31.3-23.2-54.1-23.2-25.5 0-46.6 9.1-63.2 27.2-16.7 18.2-25 41.2-25 69.1 0 27.9 8.3 51 25 69.3 16.7 18.3 37.7 27.4 63.2 27.4 22.5 0 40.5-7.7 54.1-23.2v6.9c0 12.5-3 22.7-9.1 30.7s-12.5 13.2-19.3 15.7c-6.8 2.4-13.7 3.7-20.7 3.7-18.7 0-34.2-6.4-46.3-19.1l-30.5 26-2.5 2.1c12.1 14.4 27.3 24.1 45.5 29.3 10.3 2.9 21.5 4.4 33.8 4.4 31.4 0 56-8.5 73.6-25.6 17.6-17.1 26.4-39.4 26.4-67.1v-174h-50.9zm-13 128.5c-8.7 9.2-19.9 13.8-33.7 13.8s-24.9-4.6-33.3-13.8c-8.7-9.2-13-20.9-13-35 0-14.1 4.3-25.7 12.8-35 8.5-9.2 19.7-13.8 33.5-13.8s25.1 4.6 33.7 13.8c8.7 9.2 13 20.9 13 35 0 14.1-4.3 25.8-13 35zM848.9 400.8c-14.4-12.1-31.4-18.1-51.2-18.1-17.7 0-32.3 4.4-44 13.1 37.6 21 76.5 38.7 116.5 53.7-1.5-21.8-8.6-38.1-21.3-48.7zM1014.8 424.1v-38.6H975v-57.3h-50.8v57.3h-24.4v38.6h24.4v43.8c16.8 5.2 33.7 9.9 50.8 14.3v-58.1h39.8zM1086.4 492.8h134.2V479c0-28.5-8.1-51.8-24.4-69.9-16.3-18.2-38.1-27.2-65.5-27.2-27.9 0-50.4 9.1-67.5 27.2-17.1 18.4-25.6 41.7-25.6 69.9 0 6.1.4 11.9 1.3 17.5 17.1 3.4 34.2 6.4 51.5 9.1-1.8-3.9-3.1-8.1-4-12.8zm15.8-60.3c7.6-6.9 17.1-10.4 28.5-10.4s20.7 3.5 27.8 10.6c7.2 7.1 12 16.4 14.4 28.1h-85.8c2.5-12 7.5-21.4 15.1-28.3zM1375 430.2v-47.6c-29 .5-51 12.7-65.9 36.6v-33.7h-50.8v137.6c16.9 1 33.9 1.8 50.8 2.4v-38.8c.1-36.6 22-55.4 65.9-56.5z"></path></g><g><path d="M401.4 687.5c5.3-5.7 12.1-8.6 20.3-8.6 7.1 0 12.9 2.4 17.2 7.3V655h16.3v84.8h-16.3v-6.3c-4.3 4.9-10.1 7.3-17.2 7.3-8.2 0-15-2.9-20.3-8.8-5.4-5.9-8.1-13.3-8.1-22.2 0-9 2.7-16.4 8.1-22.3zm7.7 22.3c0 4.5 1.4 8.3 4.2 11.2 2.8 3 6.4 4.4 10.8 4.4s8-1.5 10.8-4.4c2.7-3 4.1-6.7 4.1-11.2 0-4.5-1.4-8.3-4.1-11.2-2.7-3-6.3-4.4-10.8-4.4s-8 1.5-10.8 4.4c-2.9 3-4.2 6.7-4.2 11.2zM472.3 655.5c1.7-1.5 3.8-2.2 6.3-2.2 2.3 0 4.4.8 6.3 2.3 1.8 1.6 2.7 3.7 2.7 6.3 0 2.7-.9 4.9-2.7 6.5-1.8 1.7-3.9 2.6-6.3 2.6-2.3 0-4.4-.8-6.3-2.5-1.8-1.7-2.7-3.9-2.7-6.6 0-2.7.9-4.9 2.7-6.4zm14.5 24.3-.1 60h-16.3v-60h16.4zM509.5 719.7c.8 1.9 2.8 3.9 6 5.9 3.2 2 6.6 3 10 3 5.7 0 8.6-1.9 8.6-5.6 0-1-.2-1.8-.7-2.5-.5-.7-1.3-1.3-2.3-1.9-1.1-.6-2-1-2.8-1.3-.8-.3-2-.7-3.5-1.1-1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22.2-8.8 9.1 0 16.6 2.9 22.3 8.7 5.7 5.8 8.6 13.3 8.6 22.4 0 9-2.9 16.5-8.6 22.4-5.8 5.9-13.3 8.9-22.3 8.9s-16.5-3-22.2-8.9c-5.8-5.9-8.7-13.3-8.7-22.3zm16 0c0 4.5 1.4 8.3 4.2 11.2 2.7 3 6.3 4.4 10.7 4.4s8-1.5 10.8-4.4c2.7-3 4.1-6.7 4.1-11.2 0-4.5-1.4-8.3-4.1-11.2-2.7-3-6.3-4.4-10.8-4.4s-8 1.5-10.8 4.4c-2.7 3-4.1 6.7-4.1 11.2zM685.9 679.8h16.8l14.7 37.9 15-37.9h16.8l-23.9 60h-15.9l-23.5-60zM761.8 687.4c5.5-5.8 12.7-8.7 21.6-8.7 8.8 0 15.8 2.9 21 8.7 5.2 5.8 7.8 13.3 7.8 22.4v4.4h-43c.8 4 2.5 7.2 5.2 9.5s5.9 3.5 9.6 3.5c6.3 0 11-2.1 14.2-6.4l11.1 8.1c-2.6 3.8-6.1 6.8-10.6 9-4.4 2.2-9.3 3.3-14.7 3.3-9 0-16.4-3-22-8.9-5.7-5.9-8.5-13.4-8.5-22.4 0-9.1 2.8-16.6 8.3-22.5zm7.6 16.6H797c-.8-3.7-2.3-6.7-4.6-9s-5.3-3.4-8.9-3.4-6.7 1.1-9.1 3.3c-2.6 2.2-4.2 5.2-5 9.1zM840.6 679.8v10.8c4.8-7.6 11.8-11.6 21.1-11.7v15.3c-14.1.3-21.1 6.4-21.1 18.1v27.5h-16.3v-60h16.3zM894.4 692.2v-12.4h7.8v-18.4h16.3v18.4h12.8v12.4h-12.8v27.6c0 1.7.2 3 .7 4 .4 1 1.1 1.8 2 2.2.9.4 1.7.7 2.5.8.7.1 1.7.2 2.9.2h4v12.6h-10.8c-11.7 0-17.6-5.8-17.6-17.3V692h-7.8zM938.6 709.8c0-9 2.9-16.5 8.7-22.4 5.8-5.9 13.2-8.8 22.2-8.8 9.1 0 16.6 2.9 22.3 8.7 5.7 5.8 8.6 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4.6-9s-5.3-3.4-8.9-3.4-6.7 1.1-9.1 3.3c-2.5 2.2-4.1 5.2-4.9 9.1zM1149.9 692.2v-12.4h7.8v-18.4h16.3v18.4h12.8v12.4H1174v27.6c0 1.7.2 3 .7 4 .4 1 1.1 1.8 2 2.2.9.4 1.7.7 2.5.8.7.1 1.7.2 2.9.2h4v12.6h-10.8c-11.7 0-17.6-5.8-17.6-17.3V692h-7.8zM1198.3 655.1h16.3v30.5c4.1-4.4 9.7-6.6 16.8-6.6 6.3 0 11.8 1.9 16.4 5.8 4.6 3.9 6.9 10 6.9 18.5v36.6h-16.3v-34.2c0-4.7-1.2-8-3.7-10s-5.2-3-8.3-3c-3 0-5.8 1-8.2 3-2.4 2-3.7 5.3-3.7 10v34.2h-16.3v-84.8zM1275.1 687.4c5.5-5.8 12.7-8.7 21.6-8.7 8.8 0 15.8 2.9 21 8.7 5.2 5.8 7.8 13.3 7.8 22.4v4.4h-43c.8 4 2.5 7.2 5.2 9.5s5.9 3.5 9.6 3.5c6.3 0 11-2.1 14.2-6.4l11.1 8.1c-2.6 3.8-6.1 6.8-10.6 9-4.4 2.2-9.3 3.3-14.7 3.3-9 0-16.4-3-22-8.9-5.7-5.9-8.5-13.4-8.5-22.4.1-9.1 2.8-16.6 8.3-22.5zm7.7 16.6h27.5c-.8-3.7-2.3-6.7-4.6-9s-5.3-3.4-8.9-3.4-6.7 1.1-9.1 3.3c-2.5 2.2-4.1 5.2-4.9 9.1zM1354 679.8v10.8c4.8-7.6 11.8-11.6 21.1-11.7v15.3c-14.1.3-21.1 6.4-21.1 18.1v27.5h-16.3v-60h16.3z"></path></g></svg>

    `

    instead of the image tag and source url. Not sure if this is ideal.Automatically inserting a class does not help but well, we are not using a page builder, only Gutenberg block on Genesis theme with option to add logo to customizer.

    • This reply was modified 5 months, 1 week ago by Rhand.
    Thread Starter Rhand

    (@rhand)

    We we add custom class custom-logo it does work again. It also loads the svg data directly in that case instead of loads it as an image. But then I wonder what will happen to the other svgs added elsewhere without this class. An email icon does seem to load well. perhaps not inline here.

    • This reply was modified 5 months, 1 week ago by Rhand.
    boompronto17

    (@boompronto17)

    @rhand

    My website also affected by the same issue and what I’ve done to fix it is to re-upload the SVG again (by using page builder’s editor) and those inline width, height attributes are replaced with the correct dimension of the SVG file. However, we’re using page builder (Elementor) so it might be a bit different from your case.

    Hope to see the incoming fix soon.

    Thread Starter Rhand

    (@rhand)

    @boompronto17 interesting that re-uploading helped reset the image attributes. I have not tried that yet. Will do. Thanks for letting me know. And yes, do hope this issue gets solved sooner rather than later.

    NightL

    (@nightl)

    Same thing happened for me after latest WordPress update

    resolved with CSS – adding width: auto & height: auto to override the new width=”1″ height=”1″

    img.site-logo {
        width: auto;
        height: auto;
        max-width: 600px !important;
    }

    @rhand in your case use custom-logo

    img.custom-logo {
        width: auto;
        height: auto;
    }

    As far as I am aware Scalable Vector Graphics don’t carry dimensions – as the are indeed scalable vectors. They will either fill all available space of the containing element or you set size by css.

    The New WordPress version has looked at the svg in the media library – seen no attributed dimensions and then added an obvious new default setting of width=”1″ height=”1″

    • This reply was modified 5 months ago by NightL.
    • This reply was modified 5 months ago by NightL.
    • This reply was modified 5 months ago by NightL.
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.