json fbexternal-a.akamaihd.net/safe_image.php 返回 1x1 图像

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11083280/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 18:24:12  来源:igfitidea点击:

fbexternal-a.akamaihd.net/safe_image.php returns a 1x1 image

jsonimagefacebook-graph-api

提问by Sjaak van der Heide

In my facebook reader app my picture sometimes doesn't show, this is because of fbexternal-a.akamaihd.net/safe_image.php won't render it.

在我的 facebook 阅读器应用程序中,我的图片有时不显示,这是因为 fbexternal-a.akamaihd.net/safe_image.php 不会呈现它。

I've taken the links from the JSON below, it's ony the relevant part of the JSON reply.

我从下面的 JSON 中获取了链接,它只是 JSON 回复的相关部分。

  "message": "http://www.youtube.com/watch?v=RJer7-eAy3o", 
  "picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQCMr5crfpv0x3lm&w=130&h=130&url=http\u00253A\u00252F\u00252Fi3.ytimg.com\u00252Fvi\u00252FRJer7-eAy3o\u00252Fmqdefault.jpg", 
  "link": "http://www.youtube.com/watch?v=RJer7-eAy3o", 
  "source": "http://www.youtube.com/v/RJer7-eAy3o?version=3&autohide=1&autoplay=1", 
  "name": "Dougie MacLean - Broken Wings", 
  "caption": "www.youtube.com", 
  "description": "Dougie MacLean's 'Broken Wings' performed with strings at The Perthshire Amber Festival, October 2005.", 
  "icon": "https://s-static.ak.facebook.com/rsrc.php/v2/yj/r/v2OnaTyTQZE.gif"

The problem is the https://fbexternal-a.akamaihd.net/safe_image.php?d=AQCMr5crfpv0x3lm&w=130&h=130&url=http\u00253A\u00252F\u00252Fi3.ytimg.com\u00252Fvi\u00252FRJer7-eAy3o\u00252Fmqdefault.jpgpart.

问题是https://fbexternal-a.akamaihd.net/safe_image.php?d=AQCMr5crfpv0x3lm&w=130&h=130&url=http\u00253A\u00252F\u00252Fi3.ytimg.com\u00252Fvi\u00252FRJer7-eAy3o\u00252Fmqdefault.jpg部分。

If I visit http://i3.ytimg.com/u00252Fvi/RJer7-eAy3o/mqdefault.jpgit shows the correct image, so that can't be the problem. Am I doing something wrong or is the safe_image.phpjust buggy and should I just strip the url to it's original url and use that?

如果我访问http://i3.ytimg.com/u00252Fvi/RJer7-eAy3o/mqdefault.jpg它会显示正确的图像,所以这不是问题。我做错了什么还是safe_image.php只是有问题,我应该将 url 剥离到它的原始 url 并使用它吗?

Tnx and greets, Sjaak

Tnx 和问候,Sjaak

回答by Mahendran Sakkarai

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 debuggerand also in sharing. But i checked with your problem, there is no space in it. so its not the solution for the above problem. It will help another one similar to my issue.

我也遇到了类似的问题。我的问题是因为图像名称中有一个“空格”。所以它没有出现在facebook 调试器中,也没有出现在共享中。但是我检查了你的问题,里面没有空间。所以它不是上述问题的解决方案。它将帮助另一个与我的问题类似的问题。

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.

我通过编码部分用连字符(“-”)替换空格来解决这个问题。之后,我在facebook 调试器中调试 url ,它出现了。这意味着 Facebook 不会显示带有“空格”的图像名称。但这背后没有合乎逻辑的原因。无论如何它会帮助某人。

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

有关更多信息,请查看Patrick D'appollonio发布的这个答案。它帮助到我。