Imagick and Lise
Posted: Wed Mar 02, 2022 10:01 am
Hello,
I use imagick to generate a thumbnail based on a pdf document. Thanks to Velden it work Like a charm.
But to simple perhaps...
The beginning of my UDT
For a single page pdf it works well. The thumbnail is well created.
The returned path is
But for multiples pages pdf document, if you want to use only the first page to generate your image you have to use :
Bad fortune, it do not work....It returns :
I have tried differents solutions to retrieve the path but... I have posted on stackoverflow because I thought Imagick was the guilty, no more answer at all...
A little help...
I use imagick to generate a thumbnail based on a pdf document. Thanks to Velden it work Like a charm.
But to simple perhaps...
The beginning of my UDT
Code: Select all
$obj = $params['item_object'];
$fd = $obj->fielddefs['envoipdf'];
$fd = $fd->GetImagePath(true) . '/' . $fd->value;
$ali = $obj->alias;
$im = new Imagick();
$im->setResolution(72,72);
$im->readImage($fd)The returned path is
Code: Select all
https://www.maropclac.com/uploads/gabkio/placa/visuel-exercice-003.pdfCode: Select all
$im->readImage($fd."[0]")Code: Select all
Fatal error: Uncaught ImagickException: Imagick::readImage(): HTTP request failed! HTTP/1.1 404 Not Found in /home/tukbix92dqp/testserv/lib/classes/class.usertagoperations.inc.php(305) : eval()'d code:7 Stack trace: #0 /home/tukbix92dqp/testserv/lib/classes/class.usertagoperations.inc.php(305) : eval()'d code(7): Imagick->readImage('https://www.maro...') #1 /home/tukbix92dqp/testserv/lib/classes/class.usertagoperations.inc.php(285): cms_user_tag_slthumb(Array, Object(Smarty_CMS)) #2 /home/tukbix92dqp/testserv/lib/classes/class.Events.php(126): UserTagOperations->CallUserTag('slthumb', Array) #3 /home/tukbix92dqp/testserv/modules/LISE/lib/class.LISEItemOperations.php(232): Events::SendEvent('LISEjourmaro', 'PostItemSave', Array) #4 /home/tukbix92dqp/testserv/modules/LISE/LISE.module.php(631): LISEItemOperations::Save(Object(LISEjourmaro), Object(LISEItem)) #5 /home/tukbix92dqp/testserv/modules/LISE/framework/action.admin_edititem.php(218): LISE->SaveItem(Object(LISEItem)) #6 /home/tukbix92dqp/testserv/modules/LISE/l in /home/tukbix92dqp/testserv/lib/classes/class.usertagoperations.inc.php(305) : eval()'d code on line 7A little help...