为什么不是';t我的og:图片在Facebook上正确更新了吗?
大家好,提前谢谢你们的帮助。我们的网站,Tom's Guide France最近更改了其徽标。 因此,我们在没有特定图片的页面上更新了og:image meta中链接的图片文件。 示例URL: og:image元的图片如下所示: 对我来说,它是一个带有向上/向下箭头的文本徽标,而不是字母I 但对于Facebook来说,这是我们的老徽标,带有手电筒 我对这两个URL都使用了调试器。 但在这两种情况下,Facebook都会看到我的旧徽标 有什么提示吗 最好的为什么不是';t我的og:图片在Facebook上正确更新了吗?,facebook,facebook-graph-api,Facebook,Facebook Graph Api,大家好,提前谢谢你们的帮助。我们的网站,Tom's Guide France最近更改了其徽标。 因此,我们在没有特定图片的页面上更新了og:image meta中链接的图片文件。 示例URL: og:image元的图片如下所示: 对我来说,它是一个带有向上/向下箭头的文本徽标,而不是字母I 但对于Facebook来说,这是我们的老徽标,带有手电筒 我对这两个URL都使用了调试器。 但在这两种情况下,Facebook都会看到我的旧徽标 有什么提示吗 最好的 Gzav公共静态函数resize\u i
Gzav公共静态函数resize\u img($srcimg,$dest\u img,$max\u width=0,$max\u height=0){
$save=$dest\u img;
$src=null;
$source_pic=$srcimg;
$imageinfo=getimagesize($source\u pic);
//打印($imageinfo);模具;
开关($imageinfo['mime']))
{
案例“image/png”:
$src=imagecreatefrompng($source\u pic);
打破
案例“图像/jpeg”:
$src=imagecreatefromjpeg($source\u pic);
打破
案例“image/gif”:
$src=imagecreatefromformgif($source\u pic);
打破
案例“image/x-ms-bmp”:
$src=imagecreatefrombmp($source\u pic);
打破
}
列表($width,$height)=getimagesize($source_pic);
$x_比率=$max_width/$width;
$y_比率=$max_高度/$height;
如果($width
$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