Dynamically resized images for og:image ok?

那年仲夏 提交于 2019-12-24 00:44:48

问题


I use ImageResizer.net to create images to dimensions I need dynamically, based on one larger source image. It's done in a url-like fashion, like so: "www.siteUrl.com/ImagePath/ImageName.jpg?width=90&height=90&crop=auto&quality=90". This resizes the image to 90x90 pixels, cropping, and setting jpeg quality to 90%.

Will this url be acceptable to og:image , so that when someone likes/links to my content within Facebook it shows a thumbnail of the image inside the og:image property?


回答1:


Yes this URL accepts og:image and works fine...

I have already used this like this eg. <meta property="og:image" content="http://www.xyz.com/Handlers/ImageGenerator.ashx?id=de69f1e1-ee64-4bd9-80b8-8546bca4ef45&amp;w=50&amp;h=50" />

Here i am using Image handler file and passing image id and image id is saved in my database associated with image path and it works fine on facebook....




回答2:


I've recently use URLs with some query string parameters for the og:image and it works fine for me.

In case you didn't know:

Facebook provides a debug tool, which allows you to check which OpenGraph meta data could be fetched from a certain domain: http://developers.facebook.com/tools/debug




回答3:


One note, Facebook wants the images to be at least 200px




回答4:


It doesn't work in my case. Image is retrieved from MySQL blob field by asp script. the debugger shows the image and gives no error but the button on the page doesn't take the image.

Page: http://www.ffkama.be/html/2_agenda_detail.asp?ps=id51

Image URL: http://www.ffkama.be/root/imager_ag.asp?id=51

UPDATE: I forgot the code in the HEAD TAG :( One thing is sure, without the 'prefix="og: h t tp://ogp.me/ns# fb: ht tp://ogp.me/ns/fb# website: h t tp://ogp.me/ns/website#"' in the HEAD Tag, the debugger doesn't give an arror and the image shows up in the dubugger but the image won't show up on your page. Then the page is cached and there are only 2 solutions: 1. rename the page 2. wait several days for the cache to expire



来源:https://stackoverflow.com/questions/9030929/dynamically-resized-images-for-ogimage-ok

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!