[cvs] [Wiki] changed: FAQ/Admin/Troubleshoot/IMP

Wiki Guest wikiguest at horde.org
Fri Nov 2 18:15:16 UTC 2007


guest [208.42.19.179]  Fri, 02 Nov 2007 11:15:15 -0700

Modified page: http://wiki.horde.org/FAQ/Admin/Troubleshoot/IMP
New Revision:  2.2
Change log:  Added an issue regarding memory exhaustion and GD image
processing

@@ -260,4 +260,24 @@

 <code>
   'timeout' => array(IMAP_READTIMEOUT => 20, IMAP_WRITETIMEOUT => 20)
 </code>
+
+++++ Large image attachments cause blank screen (PHP memory exhausted)
errors (Horde 3.1.4)
+
+If your users are seeing the 'blank screen' error when trying to view a
message with a large image attached, try this solution. In my case HORDE was
trying to run the image through a GD function and running out of memory.
Here is a test that avoids running the GD function if the image is larger
than aprox. 600k. This code is not yet well tested, so admin beware.
+
+In /lib/Horde/Image/gd.php
+
+Before line 1031 (was "$result = call_user_func_array($function,
$params);"), insert
+
+Code:
+
+        // MODIFICATION - prevent running a GD function on a greater than
600K image
+        // this was causing memory exhaustion on very large images
+        if ($function == 'imageCreateFromString') {
+          $string_size = mb_strlen($params[0], 'latin1');
+          if ($string_size > 600000) {
+            return;
+          }
+        }
+        $result = call_user_func_array($function, $params);


More information about the cvs mailing list