From: Michael M Slusarz Date: Fri, 23 Jul 2010 22:35:04 +0000 (-0600) Subject: Fix unknown image display for PDF thumbnails X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=878796061d9792971ff2266bbc7f3dadd1098b4c;p=horde.git Fix unknown image display for PDF thumbnails --- diff --git a/imp/lib/Mime/Viewer/Pdf.php b/imp/lib/Mime/Viewer/Pdf.php index 2ab3c7b27..b5653d237 100644 --- a/imp/lib/Mime/Viewer/Pdf.php +++ b/imp/lib/Mime/Viewer/Pdf.php @@ -112,6 +112,7 @@ class IMP_Horde_Mime_Viewer_Pdf extends Horde_Mime_Viewer_Pdf if (!$GLOBALS['conf']['image']['driver']) { return false; } + $context = array('tmpdir' => Horde::getTempdir()); if (!empty($GLOBALS['conf']['image']['convert'])) { $context['convert'] = $GLOBALS['conf']['image']['convert']; @@ -125,7 +126,7 @@ class IMP_Horde_Mime_Viewer_Pdf extends Horde_Mime_Viewer_Pdf if (!$img->hasCapability('multipage') && !$img->hasCapability('pdf')) { return false; } - + if ($load) { try { $ret = $img->loadString($this->_mimepart->getContents()); @@ -134,7 +135,11 @@ class IMP_Horde_Mime_Viewer_Pdf extends Horde_Mime_Viewer_Pdf } } - return $img->getImageAtIndex(0); + try { + return $img->getImageAtIndex(0); + } catch (Horde_Image_Exception $e) { + return false; + } } /**