How does Marfeel detect the images of an article?

Marfeel detects the images and videos an article has to:

  1. Display the main image of an article in Compass view
  2. Compute Image count
  3. Compute Video count

Main image of an article

Marfeel detects the main image of an article following this waterfall process:

  1. LD+JSON data (For more details visit image - Schema.org Property):
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "NewsArticle",
      "image": "mainImage.jpg"
    }
    </script>
    
  2. Microdata
    <img itemprop="image" src="https://domain.com/path/to/img.jpg">
    
  3. Or from Meta OG types:
    <meta property="og:image" content="https://mywebsite.com/images/mainImage.jpg" />
    

Image count

Marfeel detects the images of an article following this process:

  1. Count the <img > nodes from a cleaned XPath DOM.
  2. If no images detected count the Images in the LD+JSON

Video count

Marfeel detects the videos of an article following this process:

  1. Count the VideoObject in the LD+JSON
  2. If no videos are found in ld+json the system counts the video nodes from a cleaned XPath DOM.