Bug #31664
closedUse quality setting in t3lib_stdGraphic->combineExec()
100%
Description
When combining jpegs (masking of images) the default quality setting is used. IMHO it would be better to use the setting from localconf.php.
Before:
$cmd = t3lib_div::imageMagickCommand('combine', '-compose over +matte ' . $this->wrapFileName($input) . ' ' . $this->wrapFileName($overlay) . ' ' . $this->wrapFileName($theMask) . ' ' . $this->wrapFileName($output)); // +matte = no alpha layer in output
$cmd = t3lib_div::imageMagickCommand('combine', '-compose over -quality '.intval($gfxConf['im_jpg_quality']).' +matte ' . $this->wrapFileName($input) . ' ' . $this->wrapFileName($overlay) . ' ' . $this->wrapFileName($theMask) . ' ' . $this->wrapFileName($output)); // +matte = no alpha layer in output
I've found that bug (feature?) when adding watermarks to my tt_content images. My tests are based on the extension df_imgwatermark. Even it's pretty old it's still working :)
Updated by Markus Klein about 13 years ago
Hi Bjoern!
Do you mind sending this as an actual change request to gerrit?
If you need help, just let us know.
Thank you, Markus
Updated by Björn Jacob about 13 years ago
Hi Markus,
I've never used Gerrit. Could you please send me a how-to? If you can tell me how to send this change request I'll try to handle it ;)
There's something wrong with my code. $gfxConf['im_jpg_quality'] is not definded. Here's the working code:
$cmd = t3lib_div::imageMagickCommand('combine', '-compose over -quality '.intval($GLOBALS['TYPO3_CONF_VARS']['GFX']['jpg_quality']).' +matte ' . $this->wrapFileName($input) . ' ' . $this->wrapFileName($overlay) . ' ' . $this->wrapFileName($theMask) . ' ' . $this->wrapFileName($output)); // +matte = no alpha layer in output
Updated by Alexander Opitz almost 10 years ago
- Is Regression set to No
Hi Bjoern,
you can read on http://wiki.typo3.org/CWT how to work with Gerrit.
Updated by Björn Jacob almost 10 years ago
This issue is freaking old. We'll have to check if it's still an issue and send if applicable a change request.
Updated by Riccardo De Contardi about 9 years ago
- Category set to Content Rendering
Updated by Riccardo De Contardi about 8 years ago
I guess it is still present on 8.5.0-dev; I've seen that in the file typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php the code:
public function combineExec($input, $overlay, $mask, $output) { if ($this->NO_IMAGE_MAGICK) { return ''; } $theMask = $this->randomName() . '.' . $this->gifExtension; // +matte = no alpha layer in output $this->imageMagickExec($mask, $theMask, '-colorspace GRAY +matte'); $parameters = '-compose over +matte ' . CommandUtility::escapeShellArgument($input) . ' ' . CommandUtility::escapeShellArgument($overlay) . ' ' . CommandUtility::escapeShellArgument($theMask) . ' ' . CommandUtility::escapeShellArgument($output); $cmd = CommandUtility::imageMagickCommand('combine', $parameters); $this->IM_commands[] = [$output, $cmd]; $ret = CommandUtility::exec($cmd); // Change the permissions of the file GeneralUtility::fixPermissions($output); if (is_file($theMask)) { @unlink($theMask); } return $ret; }
the quality parameter is absent (AFAICS)
Updated by Susanne Moog about 7 years ago
- Category changed from Content Rendering to Image Generation / GIFBUILDER
Updated by Gerrit Code Review over 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60464
Updated by Benni Mack over 5 years ago
Hi Björn,
by now you should be able to submit a patch to gerrit - but I took care of it for you in the meantime ;) - Thanks for making TYPO3 better.
Let me know if the patch works for you!
All the best,
Benni.
Updated by Gerrit Code Review over 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60464
Updated by Gerrit Code Review over 5 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60478
Updated by Benni Mack over 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 89a75c59284dd19e496564d2c10bb577e93e0644.