QQ 1640076782

2014年02月28日

image(imagefontheight,imagefontwidth,imagestring) errors

Filed under: phper — 标签:, , , — lijie @ 1:10 上午

空间升级为5.3以后遇到以下错误

Warning: imagefontheight() expects parameter 1 to be long, string given in C:\xampp\htdocs\oscommerce\catalog\admin\includes\classes\phplot.php on line 675

Warning: imagefontheight() expects parameter 1 to be long, string given in C:\xampp\htdocs\oscommerce\catalog\admin\includes\classes\phplot.php on line 679

Warning: imagefontwidth() expects parameter 1 to be long, string given in C:\xampp\htdocs\oscommerce\catalog\admin\includes\classes\phplot.php on line 680

Warning: imagestring() expects parameter 2 to be long, string given in C:\xampp\htdocs\oscommerce\catalog\admin\includes\classes\phplot.php on line 689
这是5.3的兼容性导致的,需要将string改为int

找到如下代码

$which_ypos = $which_ypos - ImageFontHeight($which_font);
$height = ImageFontHeight($which_font);
$width = ImageFontWidth($which_font);
ImageString($this->img, $which_font, $xpos, ($i*$height + $which_ypos), $str[$i], $which_color);
将他变为:
$which_ypos = $which_ypos - ImageFontHeight( (int)$which_font );
$height = ImageFontHeight( (int)$which_font );
$width = ImageFontWidth( (int)$which_font );
ImageString($this->img, (int)$which_font, $xpos, ($i*$height + $which_ypos), $str[$i], $which_color);

这样问题就得以解决

如果你有外贸企业网站建站需求,欢迎随时联系我们

QQ客服:415682727

电话:020-39907297