Facebook Thumbnails Issue Traced to safe_image.php

空扰寡人 提交于 2019-12-10 02:19:09

问题


For some reason, facebook's safe_image.php script isn't generating thumbnails, properly. It's generating a 1x1 image... even though the correct image is linked in the script's parameters. Example:

<img class="img" alt="" src="https://s-external.ak.fbcdn.net
/safe_image.php?d=AQBtrCt_Es_KsED0&w=90&h=90&url=http%3A%2F
%2Fwww.southlapatriots.info%2Fimages%2FScamra%2FJayCastilleCouncil2.jpg"

The linked image is correct, but it is still only generating a 1x1 image.


回答1:


Got the same problem today, in my case was an https issue.

I automatically redirect every http requests to https, and while the browser works this out normally, FB's safe_image.php doesn't. If you have such redirect as well, you may want to disable it for just your og:image file.




回答2:


I also get into a similar problem. My problem is because of the image name has a "space" in it. so it is not appear in the facebook debugger and also in sharing.

So i fixed the issue by replace space with hyphen("-") through coding part. After that i debug the url in facebook debugger, it appears. That means Facebook wont show the image name with "space". But there is no logical reason behind this. Anyway it will help someone.

For more information check this answer posted by Patrick D'appollonio. It helps me.




回答3:


Are you using any sort of gzip compression for your images? We are seeing a similar issue, but we compress our image with gzip and set the headers. Browsers are rendering fine, but Facebook is essentially displaying nothing.




回答4:


safe_image script code doesn't support having a % in the app's image url (which is probably why the image turns into a 1x1 transparent pixel)

so the solution is here . Try to follow the instruction in the first comment by chris




回答5:


In my case, the directory including genuine targeted images is under ".htaccess" control, in which images being called from external server is prohibited.

Example of blocking ".htaccess" file such as:

<FilesMatch "\.(jpg)$">
SetEnvIf Referer "^http://www.mysite.jp" ref_ok
order deny,allow
deny from all
allow from env=ref_ok
</FilesMatch>


来源:https://stackoverflow.com/questions/8084172/facebook-thumbnails-issue-traced-to-safe-image-php

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