From: Michael M Slusarz Date: Wed, 12 Nov 2008 04:36:43 +0000 (-0700) Subject: Make the max size of image viewable inline configurable X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=77884cb20ae5193ea47fbc61c7987879f349d55f;p=horde.git Make the max size of image viewable inline configurable --- diff --git a/imp/config/mime_drivers.php.dist b/imp/config/mime_drivers.php.dist index 05ff22ec4..0c7e4290a 100644 --- a/imp/config/mime_drivers.php.dist +++ b/imp/config/mime_drivers.php.dist @@ -105,7 +105,9 @@ $mime_drivers['imp']['images'] = array( 'default' => 'image.png' ), /* Display thumbnails for all images, not just large images? */ - 'allthumbs' => true + 'allthumbs' => true, + /* Display images inline that are less than this size. */ + 'inlinesize' => 262144 ); /** diff --git a/imp/lib/Mime/Viewer/images.php b/imp/lib/Mime/Viewer/images.php index d70164e3f..b1f18ddc9 100644 --- a/imp/lib/Mime/Viewer/images.php +++ b/imp/lib/Mime/Viewer/images.php @@ -75,9 +75,10 @@ class IMP_Horde_Mime_Viewer_images extends Horde_Mime_Viewer_images protected function _renderInline() { /* Only display the image inline if the browser can display it and the - * size of the image is small. */ + * size of the image is below the config value. */ if ($GLOBALS['browser']->isViewable($this->_getType())) { - if ($this->_mimepart->getBytes() < 51200) { + if (isset($this->_conf['inlinesize']) && + ($this->_mimepart->getBytes() < $this->_conf['inlinesize'])) { /* Viewing inline, and the browser can handle the image type * directly. So output an tag to load the image. */ return array(