Closed GoogleCodeExporter closed 8 years ago
You must configure TimThumb :
define ('ALLOW_EXTERNAL', TRUE);
and
$ALLOWED_SITES = array (
'facebook.com'
);
Original comment by neopheus
on 18 Aug 2011 at 10:20
now i get 'The remote file is not a valid image.'
Original comment by p.ba...@eminus.pl
on 18 Aug 2011 at 10:31
[deleted comment]
i have exactly the same problem.
timthumb works fine, but not with facebook graph.
what can it be?
heeeeelp!?
Original comment by gpin...@gmail.com
on 21 Oct 2011 at 6:21
URL getting error sample:
http://republicarayada.com.mx/timthumb.php?src=https://graph.facebook.com/100000
043114207/picture?type=normal&h=104&w=83&zc=1
please!
Original comment by gpin...@gmail.com
on 21 Oct 2011 at 6:30
i used a function that gets a real url for me and then timthumb on realurl
public function getRealUrl($photoLink) {
curl_setopt($this->curl, CURLOPT_HTTPHEADER, $this->header);
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, false);
curl_setopt($this->curl, CURLOPT_HEADER, false);
curl_setopt($this->curl, CURLOPT_USERAGENT, $this->useragent);
curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($this->curl, CURLOPT_TIMEOUT, 15);
curl_setopt($this->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($this->curl, CURLOPT_URL, $photoLink);
//this assumes your code is into a class method, and uses $this->readHeader as the callback //function
curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, array(&$this,'readHeader'));
$response = curl_exec($this->curl);
if(!curl_errno($this->curl)) {
$info = curl_getinfo($this->curl);
// var_dump($info);
if($info["http_code"] == 302) {
$headers = $this->getHeaders();
if(isset($headers['fileUrl'])) {
return $headers['fileUrl'];
}
}
}
return false;
}
Original comment by p.ba...@eminus.pl
on 24 Oct 2011 at 7:14
Facebook defaults to an HTTPS protocol. Try changing it to HTTP and it should
work. That said, I'm here because of the same issue and there's no changing how
Facebook delivers the URL.
I'll try that function though.
Original comment by patrickw...@gmail.com
on 3 Apr 2012 at 12:20
The comment in point 6 is the best solution for this
Original comment by BinaryMoon
on 27 Sep 2013 at 9:06
Original issue reported on code.google.com by
p.ba...@eminus.pl
on 18 Aug 2011 at 10:08