大家好,并提前感谢您的帮助。我们的网站Tom's Guide France最近改变了它的标识。 因此,我们在没有特定页面的页面上更新了我们的og:image meta中链接的图片文件。 示例网址:http://www.tomsguide.fr/solutions/id-2109117/desimlockage-dallas-urgent.html
og:image meta的图片如下:http://m.bestofmedia.com/sfp/images/design/logos/fb/tgu_pic.jpg 对我来说,这是一个带有上/下箭头的文字标识,而不是字母I.
但是对于Facebook来说,这是我们的旧标识,带有手电筒。
我将调试器用于这两个URL。 但在这两种情况下,Facebook都会看到我的旧徽标。
任何提示?
最佳,
Gzav
答案 0 :(得分:0)
public static function resize_img($ srcimg,$ dest_img,$ max_width = 0,$ max_height = 0){
$save = $dest_img;
$src = null;
$source_pic = $srcimg;
$imageinfo = getimagesize($source_pic);
//print_r($imageinfo);die;
switch($imageinfo['mime'])
{
case 'image/png':
$src = imagecreatefrompng($source_pic);
break;
case 'image/jpeg':
$src = imagecreatefromjpeg($source_pic);
break;
case 'image/gif':
$src = imagecreatefromgif($source_pic);
break;
case 'image/x-ms-bmp':
$src = imagecreatefrombmp($source_pic);
break;
}
list($width,$height) = getimagesize($source_pic);
$x_ratio = $max_width / $width;
$y_ratio = $max_height / $height;
if( ($width <= $max_width) && ($height <= $max_height) ){
$tn_width = $width;
$tn_height = $height;
}
elseif($y_ratio == 0){
$tn_height = ceil($x_ratio * $height);
$tn_width = $max_width;
}
elseif($x_ratio == 0){
$tn_width = ceil($y_ratio * $width);
$tn_height = $max_height;
}
elseif (($x_ratio * $height) < $max_height){
$tn_height = ceil($x_ratio * $height);
$tn_width = $max_width;
}
else{
$tn_width = ceil($y_ratio * $width);
$tn_height = $max_height;
}
// $ext = strtolower(array_pop(explode(".", $srcimg)));
$ext=substr($srcimg,-3,3);
//ini_set('memory_limit', '32M');
$tmp=imagecreatetruecolor($tn_width,$tn_height);
//print_r($tmp.$src);die;
imagecopyresampled($tmp,$src,0,0,0,0,$tn_width, $tn_height,$width,$height);
if(($ext=="jpg") || ($ext=="jpeg"))
{
$ye = imagejpeg($tmp, $save, 100) ;
}
if($ext=="gif"){ imagegif($tmp, $save) ; }
if($ext=="bmp"){ imagebmp($tmp, $save) ; }
if($ext=="png"){
//imagecolortransparent($tmp, imagecolorallocate($tmp,0,0,0));
imagepng($tmp, $save, 9) ;
}
}
$this->resize_img($siurcename,$dest_img2,83,83);//calling function