Support » Plugin: AMP » Error in Inline Images

  • Resolved Shivy23

    (@shivy23)


    After the version 1.5.0 update, I’m getting the following error in AMP Validator:

    The attribute 'src' in tag 'IMG-I-AMPHTML-INTRINSIC-SIZER' is set to the invalid value 'data:image/svg+xml;charset=utf-8,<svg height="938" width="1333.8226950355" xmlns="http://www.w3.org/2000/svg" version="1.1"/>'.

    This only occurs for inline images. Other images on this page (and other pages) on the site are fine. But any page with an inline image is failing AMP validation.

    Updating the plugin to version 1.5.1 did not help. The site is hosted on WordPress.com, not using any third-party caching plugin.

    Let me know if you need more info.

    • This topic was modified 2 years, 8 months ago by Shivy23.

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

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Thanks for raising this. This looks like a bug in the AMP validator. For a quick fix, please disable the Optimizer using this plugin: https://gist.github.com/westonruter/8d52c0b807e6dfbbdf2219622d0f4a7e

    Thread Starter Shivy23

    (@shivy23)

    It’s not only the AMP validator. Google Search Console is also reporting the same error on all pages with inline images on the site.

    GSC shows the following error for the page:

    Disallowed attribute or attribute value present in HTML tag.

    I’ll disable the optimizer for the time being, but that will disable the new AMP SSR thing as well, right?

    Plugin Author Weston Ruter

    (@westonruter)

    It will disable the SSR, yes, but only temporarily until we can figure out what is going on.

    Does GSC indicate which HTML tag is invalid? What attribute is invalid? It may just be referring to the i-amphtml-sizer > img element.

    Thread Starter Shivy23

    (@shivy23)

    GSC indicates the following two code blocks as errors:

    <img alt="" aria-hidden="true" class="i-amphtml-intrinsic-sizer" role="presentation" src="data:image/svg+xml;charset=utf-8,<svg height=&quot;906&quot; width=&quot;1164.0451693852&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot;/>"></i-amphtml-sizer>

    <img alt="" aria-hidden="true" class="i-amphtml-intrinsic-sizer" role="presentation" src="data:image/svg+xml;charset=utf-8,<svg height=&quot;938&quot; width=&quot;1333.8226950355&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot;/>"></i-amphtml-sizer>

    • This reply was modified 2 years, 8 months ago by Shivy23.
    Thread Starter Shivy23

    (@shivy23)

    Thanks for the code to disable AMP Optimizer, it worked.

    Plugin Author Weston Ruter

    (@westonruter)

    OK, thanks. That confirms the cause of the problem being decimal values in the sizer image. I’ve filed a bug here which you can subscribe to for updates: https://github.com/ampproject/amp-wp/issues/4493

    Plugin Author Weston Ruter

    (@westonruter)

    @shivy23 We have a fix for this merged and ready for testing: https://github.com/ampproject/amp-wp/pull/4506#issuecomment-607954492

    The quick fix is to cast the dimensions to integers. Once AMP allows decimals for the sizer image, we’ll revert that change to emit decimal dimensions again.

    Thread Starter Shivy23

    (@shivy23)

    That’s great news! Unfortunately, I can’t test it since the plugin is managed by WordPress.com on my site.

    Plugin Author Weston Ruter

    (@westonruter)

    Ok, the v1.5.2 release should be out tomorrow for you to upgrade.

    Plugin Author Weston Ruter

    (@westonruter)

    @shivy23 We’ve just published the 1.5.2 release to WordPress.org: https://wordpress.org/plugins/amp/

    You can update now via the WordPress admin.

    Release notes: https://github.com/ampproject/amp-wp/releases/tag/1.5.2

    Thread Starter Shivy23

    (@shivy23)

    Installed the version 1.5.2 update and removed the AMP Optimizer disabler script you shared. The page is now passing AMP validation.

    Thank you for the quick fix.

    Plugin Author Weston Ruter

    (@westonruter)

    Note: I’ve changed the amp-disable-optimizer plugin into amp-disable-ssr. I realized that the Optimizer as a whole did not need to be disabled. Only the SSR needed to be disabled to prevent this issue with the SVG sizer image. Please use this replacement plugin instead.

    Hey hi ,
    I also got the same error yesterday in my Google webmaster tool , can you please help me out .
    In AMP section total 8 pages affected . But when i check in the AMP validator ,only two showed errors out of total 8 . Don’t know why in GSC it is showing 8 error pages .

    http://electronicsguide4u.com/unfortunately-google-play-services-has-stopped-now-what-google-play-services-keeps-stopping-issue-fix/amp/

    Note : After disabling the W3 total cache plugin in my WordPress dashboard i am experiencing this issue . After disabling too , i can see the cached pages still present in my Google analytics page.

    Please help me out in this .Also i have the latest AMP plugin version installed i.e. 1.5.3

    Plugin Author Weston Ruter

    (@westonruter)

    @arikjeet Please open a new support topic.

    Plugin Author Weston Ruter

    (@westonruter)

    W3 Total Cache v0.13.3 has been released to fix this issue. After upgrading, you can deactivate and install my “AMP Disable SSR” plugin (no need to disable server-side rendering or the AMP Optimizer as a whole any longer).

    Update: This isn’t relevant to this issue.

    • This reply was modified 2 years, 7 months ago by Weston Ruter.
Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Error in Inline Images’ is closed to new replies.