Project

General

Profile

Actions

Bug #46728

closed

ADJUST in GIFBUILDER not working as documented

Added by Den Denyer over 11 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-03-27
Due date:
% Done:

50%

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

Description

Hi Guys,

Referencing bug #13724, I am the one guy on the internet trying to use ADJUST in his GIFBUILDER objects, only to discover it doesn't work if implemented as documented.

My extension code is as follows:

        $image = array();
        $image['10'] = "IMAGE";
        $image['10.']['file'] = 'GIFBUILDER'; 
        $image['10.']['file.']['format'] = 'jpg';
        $image['10.']['file.']['XY'] = "{$conf['width']},{$conf['height']}";
        $image['10.']['file.']['backColor'] = '#ffffff';

        $image['10.']['file.']['10'] = 'IMAGE';
        $image['10.']['file.']['10.']['file'] = 'uploads/pics/'.$row['image'];
        $image['10.']['file.']['10.']['file.']['XY'] = '[10.w],[10.h]';
        $image['10.']['file.']['10.']['file.']['width'] = ($conf['width']-20);
        $image['10.']['file.']['10.']['align'] = 'c,c';
        $image['10.']['file.']['20'] = 'ADJUST';
        $image['10.']['file.']['20.']['value']= 'inputLevels = 0, 200';

I tried various permutations of the value, nothing seemed to work. When I swapped it out for an EFFECT (gamma) it worked just fine, so my conclusion is the ADJUST is broken.

I went digging into the source and ended up at inputLevels() in the stdgraphics lib code. Here it seems that the following is called:

(Code here: https://github.com/TYPO3/TYPO3v4-Core/blob/master/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php#L1957 )

$totalCols = ImageColorsTotal($im);

This returns 0 on true-colour images, which then fails to perform any adjustments.

Might be worth mentioning in the docs that this is not suitable for 256 colour images, and/or get someone smarter than me to make it work with any supplied image! :D

(Also I couldn't find the relevant tracker to add this to as a code bug, which is why it's here in the TS Ref tracker. Please move / repost / let me know which group is correct for this!)

Actions

Also available in: Atom PDF