how can i change the dpi of an image with the imagick extension

我怕爱的太早我们不能终老 提交于 2019-11-29 07:29:16

MatTheCat's answer is spot on. You might also try setImageUnits() to ensure it's working with inches and not centimeters.

$image->setImageUnits(imagick::RESOLUTION_PIXELSPERINCH);
$image->setImageResolution(72,72);

Resampling isn't necessary just to change dpi.

Note that changing the dpi alone will not affect file size and only applies to resampling and printing.

It seems you have to use setImageResolution rather than setResolution : http://www.php.net/manual/fr/function.imagick-setresolution.php#95533

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!