From 2c264f836c382f3c3555918484c749d0633a8308 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Fri, 4 May 2012 23:53:29 +0200 Subject: [PATCH] Contacts: Better checks for GD library. --- apps/contacts/photo.php | 5 +++++ apps/contacts/thumbnail.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/contacts/photo.php b/apps/contacts/photo.php index 6fe68cefb6d..729c2dfbcfd 100755 --- a/apps/contacts/photo.php +++ b/apps/contacts/photo.php @@ -26,6 +26,11 @@ if(is_null($id)) { getStandardImage(); } +if(!extension_loaded('gd') || !function_exists('gd_info')) { + OCP\Util::writeLog('contacts','photo.php. GD module not installed',OCP\Util::DEBUG); + getStandardImage(); +} + $contact = OC_Contacts_App::getContactVCard($id); $image = new OC_Image(); if(!$image) { diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php index 11d1db03108..5b340042a25 100755 --- a/apps/contacts/thumbnail.php +++ b/apps/contacts/thumbnail.php @@ -32,7 +32,7 @@ function getStandardImage(){ OCP\Response::redirect(OCP\Util::imagePath('contacts', 'person.png')); } -if(!function_exists('imagecreatefromjpeg')) { +if(!extension_loaded('gd') || !function_exists('gd_info')) { OCP\Util::writeLog('contacts','thumbnail.php. GD module not installed',OCP\Util::DEBUG); getStandardImage(); exit(); -- 2.39.5