Witam, mam funkcję pobierającą profilowe użytkownika z fb, potrzebuje je miec: 108px/108px, funkcja bez względu jaki typ podam (small/large) zwraca mi malutkie zdjęcie, a jak próbuję je "przeskalować" to wychodzi całe czarne, jakis pomysł?
function getFbPictureUrl($facebookID) {
$retVal = null;
try {
'appId' => $config['appId'],
'secret' => $config['secret'],
'cookie' => $config['cookie']
));
$data = $fb->api($facebookID, array( 'fields' => 'picture',
'type' => 'large'
));
$retVal = $data['picture'];
}catch (Exception $e) {
$retVal = null;
}
return $retVal;
}
$im = $this->getFbPictureUrl($fid);
$width = imagesx($img);
$height = imagesy($img);
$width_mini = 108; // szerokosc obrazka
$height_mini = 108; // wysokosc obrazka
$img_mini = imagecreatetruecolor($width_mini, $height_mini);
imagecopyresampled($img_mini, $img, 0, 0, 0, 0, $width_mini , $height_mini, $width , $height);
imagejpeg($img_mini, "../css/avatars/min-".$this->file_name."", 80);
imagedestroy($img);
imagedestroy($img_mini);