imagescale 无法正常工作
imagescale does not work correctly
我正在使用 imagescale
复制图像的一部分:
$img = imagecreatefromjpeg('before.jpg');
$img = imagescale($img, 660, 384);
之前:
之后:
使用颜色较少的图片效果很好。
PHP 文档中的评论提出了解决方案。
http://php.net/manual/en/function.imagescale.php
imageScale has got troubles with scaling images...
It can output Segmentation Fault when you want to provide custom $mode argument.
How to scale image with interpolation in php gd?
Use imagecopyresampled() instead of imagescale().
我正在使用 imagescale
复制图像的一部分:
$img = imagecreatefromjpeg('before.jpg');
$img = imagescale($img, 660, 384);
之前:
之后:
使用颜色较少的图片效果很好。
PHP 文档中的评论提出了解决方案。
http://php.net/manual/en/function.imagescale.php
imageScale has got troubles with scaling images... It can output Segmentation Fault when you want to provide custom $mode argument. How to scale image with interpolation in php gd? Use imagecopyresampled() instead of imagescale().