Project

General

Profile

Actions

Bug #31664

closed

Use quality setting in t3lib_stdGraphic->combineExec()

Added by Björn Jacob about 13 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Image Generation / GIFBUILDER
Target version:
-
Start date:
2011-11-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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 :)

Actions #1

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

Actions #2

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
Actions #3

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.

Actions #4

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.

Actions #5

Updated by Riccardo De Contardi about 9 years ago

  • Category set to Content Rendering
Actions #6

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)

Actions #7

Updated by Susanne Moog about 7 years ago

  • Category changed from Content Rendering to Image Generation / GIFBUILDER
Actions #8

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

Actions #9

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.

Actions #10

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

Actions #11

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

Actions #12

Updated by Benni Mack over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #13

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF