From 9f84111e16efae4621dc64ee8a21b816322b9bc7 Mon Sep 17 00:00:00 2001 From: Leo Germani Date: Fri, 18 May 2018 16:21:50 -0300 Subject: [PATCH] Better perfomance to generate thumb from pdf --- src/classes/class-tainacan-media.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/classes/class-tainacan-media.php b/src/classes/class-tainacan-media.php index cfa6ff43b..fd00df997 100644 --- a/src/classes/class-tainacan-media.php +++ b/src/classes/class-tainacan-media.php @@ -109,8 +109,10 @@ class Media { return null; } - $imagick = new \Imagick($filepath); - $imagick->setIteratorIndex(0); + $imagick = new \Imagick(); + $imagick->setResolution(72,72); + $imagick->readImage($filepath . '[0]'); + //$imagick->setIteratorIndex(0); $imagick->setImageFormat('jpg'); return $imagick->getImageBlob(); }