<configstring name="width" desc="Thumbnail width">150</configstring>
<configstring name="height" desc="Thumbnail
height">150</configstring>
+ <configswitch name="unsharp" desc="Should Horde apply an unsharpmask filter
+ to the image after it's resized?">
+ <case name="true" desc="Yes">
+ <configstring name="radius" desc="Radius">0.7</configstring>
+ <configstring name="amount" desc="Amount">1</configstring>
+ <configstring name="threshold" desc="Threshold">0.05</configstring>
+ </case>
+ <case name="false" desc="No" />
+ </configswitch>
+
</configsection>
</configtab>
width">800</configstring>
<configstring name="height" desc="Screen photo
height">600</configstring>
+ <configswitch name="unsharp" desc="Should Horde apply an unsharpmask filter
+ to the image after it's resized?">
+ <case name="true" desc="Yes">
+ <configstring name="radius" desc="Radius">0.5</configstring>
+ <configstring name="amount" desc="Amount">1.2</configstring>
+ <configstring name="threshold" desc="Threshold">0.05</configstring>
+ </case>
+ <case name="false" desc="No" />
+ </configswitch>
+
</configsection>
</configtab>
static public function getImageObject($params = array())
{
global $conf;
- $context = array('tmpdir' => Horde::getTempDir());
+ $context = array('tmpdir' => Horde::getTempDir(),
+ 'logger' => $GLOBALS['injector']->getInstance('Horde_Log_Logger'));
if (!empty($conf['image']['convert'])) {
$context['convert'] = $conf['image']['convert'];
$context['identify'] = $conf['image']['identify'];
$this->_image->resize(min(50, $this->_dimensions['width']),
min(50, $this->_dimensions['height']),
true);
+ if ($GLOBALS['conf']['thumbnail']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
+ try {
+ $this->_image->addEffect('Unsharpmask',
+ array('radius' => $GLOBALS['conf']['thumbnail']['radius'],
+ 'threshold' => $GLOBALS['conf']['thumbnail']['threshold'],
+ 'amount' => $GLOBALS['conf']['thumbnail']['amount']));
+ $this->_image->applyEffects();
+ } catch (Horde_Image_Exception $e) {
+ throw new Ansel_Exception($e);
+ }
+ }
return $this->_image->getHordeImage();
}
$this->_image->addEffect('PolaroidImage',
array('background' => $styleDef['background'],
'padding' => 5));
-
+ if ($GLOBALS['conf']['thumbnail']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
+ $this->_image->addEffect('Unsharpmask',
+ array('radius' => $GLOBALS['conf']['thumbnail']['radius'],
+ 'threshold' => $GLOBALS['conf']['thumbnail']['threshold'],
+ 'amount' => $GLOBALS['conf']['thumbnail']['amount']));
+ }
$this->_image->applyEffects();
} catch (Horde_Image_Exception $e) {
throw new Ansel_Exception($e);
'padding' => 5,
'distance' => 5,
'fade' => 3));
+ if ($GLOBALS['conf']['thumbnail']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
+ $this->_image->addEffect('Unsharpmask',
+ array('radius' => $GLOBALS['conf']['thumbnail']['radius'],
+ 'threshold' => $GLOBALS['conf']['thumbnail']['threshold'],
+ 'amount' => $GLOBALS['conf']['thumbnail']['amount']));
+ }
+
+ $this->_image->applyEffects();
} catch (Horde_Image_Exception $e) {
throw new Ansel_Exception($e);
}
- $this->_image->applyEffects();
return $this->_image->getHordeImage();
}
$this->_image->resize(min($GLOBALS['conf']['screen']['width'], $this->_dimensions['width']),
min($GLOBALS['conf']['screen']['height'], $this->_dimensions['height']),
true);
+ if ($GLOBALS['conf']['screen']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
+ try {
+ $this->_image->addEffect('Unsharpmask',
+ array('radius' => $GLOBALS['conf']['screen']['radius'],
+ 'threshold' => $GLOBALS['conf']['screen']['threshold'],
+ 'amount' => $GLOBALS['conf']['screen']['amount']));
+ $this->_image->applyEffects();
+ } catch (Horde_Image $e) {
+ throw new Ansel_Exception($e);
+ }
+ }
return $this->_image->getHordeImage();
}
'padding' => 5,
'distance' => 8,
'fade' => 2));
+
+ if ($GLOBALS['conf']['thumbnail']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
+ $this->_image->addEffect('Unsharpmask',
+ array('radius' => $GLOBALS['conf']['thumbnail']['radius'],
+ 'threshold' => $GLOBALS['conf']['thumbnail']['threshold'],
+ 'amount' => $GLOBALS['conf']['thumbnail']['amount']));
+ $this->_image->applyEffects();
+ }
+
$this->_image->applyEffects();
} catch (Horde_Image_Exception $e) {
throw new Ansel_Exception($e);
$this->_image->resize(min($GLOBALS['conf']['thumbnail']['width'], $this->_dimensions['width']),
min($GLOBALS['conf']['thumbnail']['height'], $this->_dimensions['height']),
true);
+ if ($GLOBALS['conf']['thumbnail']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
+ try {
+ $this->_image->addEffect('Unsharpmask',
+ array('radius' => $GLOBALS['conf']['thumbnail']['radius'],
+ 'threshold' => $GLOBALS['conf']['thumbnail']['threshold'],
+ 'amount' => $GLOBALS['conf']['thumbnail']['amount']));
+ $this->_image->applyEffects();
+ } catch (Horde_Image_Exception $e) {
+ throw new Ansel_Exception($e);
+ }
+ }
+
return $this->_image->getHordeImage();
}