Project

General

Profile

Bug #36597 » 36597.diff

Bernd Niehues, 2012-11-07 16:04

View differences:

class.t3lib_stdgraphic.php 2012-11-07 15:56:41.907526000 +0100
var $csConvObj;
var $nativeCharset = ''; // Is set to the native character set of the input strings.
protected $IMversion = 0; // ImageMagick Version Nummer formated like this 6000700070005
/**
* Init function. Must always call this when using the class.
......
}
if (!$gfxConf['im']) {
$this->NO_IMAGE_MAGICK = 1;
} else {
$cmd = t3lib_div::imageMagickCommand('identify','-version | grep Version:');
$ret = explode(' ',t3lib_utility_Command::exec($cmd));
$ret = explode('.',str_replace('-','.',$ret[2]));
$this->IMversion = $ret[0].str_pad($ret[1],4,'0',STR_PAD_LEFT).str_pad($ret[2],4,'0',STR_PAD_LEFT).str_pad($ret[3],4,'0',STR_PAD_LEFT);
}
if (!$this->NO_IMAGE_MAGICK && (!$gfxConf['im_version_5'] || $gfxConf['im_version_5'] === 'im4' || $gfxConf['im_version_5'] === 'im5')) {
throw new RuntimeException(
......
// Setting default JPG parameters:
$this->jpegQuality = t3lib_utility_Math::forceIntegerInRange($gfxConf['jpg_quality'], 10, 100, 75);
$this->cmds['jpg'] = $this->cmds['jpeg'] = '-colorspace RGB -sharpen 50 -quality ' . $this->jpegQuality;
$this->cmds['jpg'] = $this->cmds['jpeg'] = '-colorspace ' . ( $this->IMversion >= 6000700050005 ? 's' : '' ) . 'RGB -sharpen 50 -quality ' . $this->jpegQuality;
if ($gfxConf['im_combine_filename']) {
$this->combineScript = $gfxConf['im_combine_filename'];
......
// - therefore must be disabled in order not to perform sharpen, blurring and such.
$this->NO_IM_EFFECTS = 1;
$this->cmds['jpg'] = $this->cmds['jpeg'] = '-colorspace RGB -quality ' . $this->jpegQuality;
$this->cmds['jpg'] = $this->cmds['jpeg'] = '-colorspace ' . ( $this->IMversion >= 6000700050005 ? 's' : '' ) . 'RGB -quality ' . $this->jpegQuality;
}
// ... but if 'im_v5effects' is set, don't care about 'im_no_effects'
if ($gfxConf['im_v5effects']) {
......
$this->V5_EFFECTS = 1;
if ($gfxConf['im_v5effects'] > 0) {
$this->cmds['jpg'] = $this->cmds['jpeg'] = '-colorspace RGB -quality ' . intval($gfxConf['jpg_quality']) . $this->v5_sharpen(10);
$this->cmds['jpg'] = $this->cmds['jpeg'] = '-colorspace ' . ( $this->IMversion >= 6000700050005 ? 's' : '' ) . 'RGB -quality ' . intval($gfxConf['jpg_quality']) . $this->v5_sharpen(10);
}
}
......
$this->csConvObj = t3lib_div::makeInstance('t3lib_cs');
}
$this->nativeCharset = 'utf-8';
}
(2-2/2)