Simon Willan
Simon Willan

Reputation: 378

Imagick Resize not working

I'm running an \Imagick::resizeImage() on a png file, and the result is TRUE, but nothing is happening to the image. No errors at all.

Here is my code:

$imagick = new \Imagick("/var/www/silex.dev/uploads/media/test.png");
$status = $imagick->resizeImage(200, 200, \Imagick::FILTER_CATROM, 1);

//$status = true

test.png exists. It has 0777, the media/ folder has 0777 and the uploads/ folder has 0777. It just simply isn't resizing.

I have also run:

if( class_exists('\Imagick') )

which resolves true also.

Here's a screenshot of the file properties, the test.png and its file path.

test

Does anyone know if I am missing something?

Many Thanks

Upvotes: 1

Views: 1409

Answers (1)

Danack
Danack

Reputation: 25721

You need to either save the file or send it to a browser to see the resized version. Imagick doesn't alter files in place.

So either $imagick->writeImage("./output.png") or echo $imagick->getImageBlob();.

Upvotes: 2

Related Questions