想象一下cropImage问题php

时间:2014-04-30 10:47:01

标签: php imagick

我的图片大小 1353 x 451 ,当我尝试将其裁剪为 1350 x 451 时,使用Imagick功能 cropImage ,我得错了输出。

返回尺寸 1350 x 236 的图片,而不是 1350 x 451

这是我使用的代码:

  $im = new Imagick();
  $im->readImage( $orig_img_path );
  $im->cropImage((int) $w, (int) $h, (int) $x, (int) $y);
  $im->writeImage($final_img_path);

$ orig_img_path 包含实际图片,我在 $ final_img_path 处写下最终图片。

有没有办法,我可以根据给定的尺寸强制适当裁剪图像?

0 个答案:

没有答案