]> source.dussan.org Git - nextcloud-server.git/commitdiff
Contacts: Better checks for GD library.
authorThomas Tanghus <thomas@tanghus.net>
Fri, 4 May 2012 21:53:29 +0000 (23:53 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Fri, 4 May 2012 21:53:29 +0000 (23:53 +0200)
apps/contacts/photo.php
apps/contacts/thumbnail.php

index 6fe68cefb6d0ce4dd5894160ac2b4f1e6e05adef..729c2dfbcfd285f284072a6a2168b569772e5da4 100755 (executable)
@@ -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) {
index 11d1db03108bfc2ed4d8efd3f476794ba2735fe2..5b340042a2503dc91a3b668a26c868a331d3e2b5 100755 (executable)
@@ -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();