summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 08e8c4f)
raw | patch | inline | side by side (parent: 08e8c4f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 10 Sep 2010 10:38:20 +0000 (10:38 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 10 Sep 2010 10:38:20 +0000 (10:38 +0000) |
-Display a warning if GOsa in unable to save user pictures due to missing packages.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19600 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19600 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/personal/generic/class_user.inc | patch | blob | history |
diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc
index 3e60bf625257a365208cdbbd6e1d4ddb48e3c370..3062a9a08a4ec9b0e495a9e9462d4f64d1356f14 100644 (file)
} else {
/* Fallback if there's no image magick inside PHP */
- if (!function_exists("imagick_blob2image")){
+ if (function_exists("imagick_blob2image")){
+
+ /* Load the new uploaded Photo */
+ if(!$handle = imagick_blob2image($this->photoData)) {
+ new log("debug","users/".get_class($this),$this->dn,array(),"Could not access uploaded image");
+ }
+
+ /* Resizing image to 147x200 and blur */
+ if(!imagick_resize($handle,147,200,IMAGICK_FILTER_GAUSSIAN,0)){
+ new log("debug","users/".get_class($this),$this->dn,array(),"Could not resize uploaded image");
+ }
+
+ /* Converting image to JPEG */
+ if(!imagick_convert($handle,"JPEG")) {
+ new log("debug","users/".get_class($this),$this->dn,array(),"Could not convert uploaded image to jepg");
+ }
+
+ /* Creating binary Code for the Image */
+ if(!$dump = imagick_image2blob($handle)){
+ new log("debug","users/".get_class($this),$this->dn,array(),"Could not create new user image");
+ }
+
+ /* Sending Image */
+ $output= $dump;
+
+ /* Save attribute */
+ $this->attrs["jpegPhoto"] = $output;
+ }elseif (exec('convert')){
/* Get temporary file name for conversation */
$fname = tempnam (TEMP_DIR, "GOsa");
/* Save attribute */
$this->attrs["jpegPhoto"] = $output;
+ }else{
+ msg_dialog::display(_("Error"),
+ _("Cannot save user picture, GOsa requires the package 'imagemagick' or 'php5-imagick' to be installed!"),
+ ERROR_DIALOG);
- } else {
-
- /* Load the new uploaded Photo */
- if(!$handle = imagick_blob2image($this->photoData)) {
- new log("debug","users/".get_class($this),$this->dn,array(),"Could not access uploaded image");
- }
-
- /* Resizing image to 147x200 and blur */
- if(!imagick_resize($handle,147,200,IMAGICK_FILTER_GAUSSIAN,0)){
- new log("debug","users/".get_class($this),$this->dn,array(),"Could not resize uploaded image");
- }
-
- /* Converting image to JPEG */
- if(!imagick_convert($handle,"JPEG")) {
- new log("debug","users/".get_class($this),$this->dn,array(),"Could not convert uploaded image to jepg");
- }
-
- /* Creating binary Code for the Image */
- if(!$dump = imagick_image2blob($handle)){
- new log("debug","users/".get_class($this),$this->dn,array(),"Could not create new user image");
- }
-
- /* Sending Image */
- $output= $dump;
-
- /* Save attribute */
- $this->attrs["jpegPhoto"] = $output;
}
-
}
/* Save data. Using 'modify' implies that the entry is already present, use 'add' for