【发布时间】:2016-05-12 05:13:11
【问题描述】:
我有一张 jpg 图片,我想将其分成两个相等的图像。分割应该发生在图像的水平中心并保存两个部分(左侧部分,右侧部分)。例如,一个 500x300 的图像将被分成两个图像,每个 250x300。我不熟悉正确的图像处理功能,当检查 PHP 的文档时,它清楚地警告说没有记录“imagecrop()”(http://php.net/manual/en/function.imagecrop.php)。 同样在stackoverflow上,我发现的唯一东西是我试图玩弄的这个sn-p:
// copy left third to output image
imagecopy($output, $orig,$padding,$padding,0, 0,$width/3,$height);
// copy central third to output image
imagecopy($output, $orig,2*$padding+$width/3,$padding,$width/3, 0,$width/3,$height);
也许你可以给我指出正确的方向。
非常感谢
【问题讨论】: