Page 1 of 1

setimageresolution() query

Posted: 2016-06-09T08:31:49-07:00
by BlissDirect
Hello,

I have written under line of codes to convert image resolution to 300. Below code, does the trick and shows it in the properties of that image file, but when I open the same file in Adobe Photoshop, it shows the original resolution and not the changed resolution.

$image = new Imagick();
$image->stripimage('test.jpg');
$image->stripimage('image300.jpg');
$image->readImage('test.jpg');
$image->setImageResolution(300,300);
$image->resampleImage(300,300,imagick::FILTER_UNDEFINED,0);
$image->writeImage('image300.jpg');

Thanks in advance!

Re: setimageresolution() query

Posted: 2016-06-09T12:58:33-07:00
by dlemstra
It might be possible that one of the profiles contains that different image resolution. You could remove that with a strip and see what happens. But you might remove other profiles that you want to keep. It seems that you already call stripImage but that method has not arguments according to the documentation (http://php.net/manual/en/imagick.stripimage.php). And you should call that after you read the file.

Re: setimageresolution() query

Posted: 2016-06-09T16:55:19-07:00
by fmw42
Perhaps deleting specific profiles may work. It is possible that it is in the 8bim or PS specific data.