[Typo3-dev] Bug when using images_frames, jpg images and quality settings
Chi Hoang
hoang at planb-media.de
Wed May 26 12:17:11 CEST 2004
Hello,
Problem was that when using jpg images and images_frames the image quality
was very poor in T3.6.1
My solution:
1. there is bug in function getImgResource($file,$fileArray) of
class.tslib_content.php when using mask and jpg. I added the lines
function getImgResource($file,$fileArray) {
...
if (!@file_exists($dest)) {
$temp_ext='png';
if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_mask_temp_ext_gif'])
{ // If ImageMagick version 5+
$temp_ext=$gifCreator->gifExtension;
}
// here comes my changes... because otherwise jpg would become gif
if ($fI['fileext'] ==='jpg') {
$temp_ext='jpg';
}
}
...
}
2. Unfortunately the image quality setting is not passed to function
combineExec($input,$overlay,$mask,$output) in class.t3lib_stdgraphic.php,
so I did harcoded it (which is bad, but I cant do better atm):
function combineExec($input,$overlay,$mask,$output) {
if (!$this->NO_IMAGE_MAGICK) {
$cmd = $this->imageMagickPath.$this->combineScript.' -compose
over -quality 100 '.$this->wrapFileName($input).'
'.$this->wrapFileName($overlay).' '.$this->wrapFileName($mask).'
'.$this->wrapFileName($output);
$this->IM_commands[] = Array ($output,$cmd);
exec($cmd);
}
}
Look at -quality 100.
My image quality is now awesome when using image_frames. I hope it might be
some help to you.
Greetings,
Chi
More information about the TYPO3-dev
mailing list