tags:

views:

25

answers:

1

I need to change all uploaded files to 72 dpi. I'm using the php imagick extension.

heres what i've tried (the image i'm using is 300dpi):

$image = new Imagick();
$image->setResolution(72,72) ;
$image->readImage($img);
$image->resampleImage  (72,72,imagick::FILTER_UNDEFINED,1);
$image->writeImage($target)

this doesn't seem to anything. the image is uploading, but stays at 300dpi

A: 

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

MatTheCat
i tried that example too, didn't change the dpi either
mononym