0

Testing posting a snippet on Google+ with following HTML -

<!DOCTYPE html>
<head>
    <meta property="og:image" content="http://i.imgur.com/le2WbeU.jpg" />   
    <meta itemprop="image" content="http://i.imgur.com/le2WbeU.jpg">
</head>
<body>    
</body>
</html>

What I see is: enter image description here

Looking at network traffic I see a failed request: enter image description here

UPDATE: Looks like it was a caching problem. Once I appended a query string on to the URL, I got the image to pull up. I must have had a bad URL to an image the first time and it cached that bad URL request.

dev.e.loper
  • 35,446
  • 76
  • 161
  • 247
  • It's possible that imgur is blocking Google's direct requests for the image. They did start recently redirecting direct image requests to an HTML page if they were not refered from Twitter/Facebook/etc. Try using some different image hosts. – abraham Mar 26 '14 at 22:58
  • Looks like it was a caching problem. Once I appended a query string on to the URL, I got the image to pull up. I must have had a bad URL to an image the first time and it cached that bad URL request. – dev.e.loper Mar 27 '14 at 02:00

2 Answers2

0

I don’t know if it causes the error, but you might want to use link instead of meta if the value is a URI.

  • The HTML5 spec defines that the meta element:

    […] represents various kinds of metadata that cannot be expressed using the […] link […] elements.

  • Microdata also explicitly requires it:

    […] the property must be specified using a URL property element


Also note that you don’t have created an item in your Microdata, so the image property is not defined (unless an item is created on the html start tag, which is missing in your example; or you reference it via itemref from the body).

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
  • Google docs specify using `meta` tags. https://developers.google.com/+/web/snippet/ Can you clarify what you are referring to by "item in your Microdata" Which item? – dev.e.loper Mar 26 '14 at 22:48
  • @dev.e.loper: It might work for Google etc., but it’s invalid Microdata. --- Re. item, this is the basic Microdata concept. A Microdata "item" gets created by using the `itemscope` attribute. It represents a thing. This item/thing can have a type (`itemtype`). All descendant properties (`itemprop`) belong to this item. In your small example, you don’t have created an item. Your `image` property doesn’t belong anywhere, it’s also not defined (it’s likely that you want to use the Schema.org vocabulary, but then you’d need to specify that.) – unor Mar 29 '14 at 23:59
0

Looks like it was a caching problem. Once I appended a query string on to the URL, I got the image to pull up. I must have had a bad URL to an image the first time and it cached that bad URL request.

dev.e.loper
  • 35,446
  • 76
  • 161
  • 247