opengraph icon indicating copy to clipboard operation
opengraph copied to clipboard

Handling Multiple OGP Image tags

Open MitchellMcKenna opened this issue 12 years ago • 1 comments

The OGP Arrays section says websites can have multiple images associated with a page and that the "first tag (from top to bottom) is given preference during conflicts".

Currently in the library it looks like if the page has multiple og:image tags, each one will overwrite the previous, so when you call $graph->image you will only get the last og:image value back. Images and any other tags that can have multiple values (eg. videos and audio) should probably return an array.

MitchellMcKenna avatar Feb 08 '13 22:02 MitchellMcKenna

Well, I'm actually experiencing some problem when I call the $graph->image and the website that I'm parsing dont have the meta property image on it.. so it is resulting in a empty array that is really bugging me out, because it is creating empty img tags (img src="" /) ... The most websites are badly formated for opengraph, its not well disseminated yet or forever, so we should improve the way we handle the results that we get from $graph-> in a better way... I'm working on it

Argonalyst avatar Feb 09 '13 23:02 Argonalyst