【发布时间】:2018-01-08 02:08:54
【问题描述】:
我在两个单独的类中有两个函数,都有一些 Imagick 处理。 我希望第一个 Imagick 调整图像大小,然后将其发送到另一个 Imagick 实例而不将其保存为文件。
头等舱
function cropimage($inputfile){
$image = new Imagick($inputfile);
$image->cropimage($w, $h, $x, $y);
# and here I wish to return some $image->output???() which let me to use it in second class
return ????;
}
在第二类调整大小
function resizeImage(){
$crop = new crop(); // my first class instance
$image_to_work = $crop->cropimage($this->image); // output from first class
$image = new Imagick($image_to_work);
$image->resizeImage($width, $height);
$image->writeImage($outputfile);
}
有什么想法吗? 提前致谢。 干杯
【问题讨论】: