Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

Scrape image:width and image:height, if available #42

Closed
wants to merge 1 commit into from

Conversation

pdehaan
Copy link
Contributor

@pdehaan pdehaan commented Aug 17, 2016

Still needs a bit of tweaking on page-metadata-service

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling f61329f on pdehaan:add-image-dimensions into * on mozilla:master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 7c88bc8 on pdehaan:add-image-dimensions into * on mozilla:master*.

@@ -34,6 +34,7 @@ const titleRules = buildRuleset('title', [

const canonicalUrlRules = buildRuleset('url', [
['meta[property="og:url"]', node => node.element.content],
['meta[name="twitter:url"]', node => node.element.content],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a separate PR.

@pdehaan
Copy link
Contributor Author

pdehaan commented Aug 19, 2016

After reading http://ogp.me/#array I'm not convinced my logic would work in all/most cases.
I can definitely see a handful of cases where it'd fail spectacularly if the page returned multiple og:image objects, but the first one in the array didn't have a specified width and height.

@pdehaan
Copy link
Contributor Author

pdehaan commented Sep 2, 2016

Closing for now, until I'm ready to fix this properly (or we move to fastimage, per mozilla/page-metadata-service#89)

@pdehaan pdehaan closed this Sep 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants