Bug #65378

Scaling/cropping images in GIFBUILDER does not work

Added by Stephan grass over 5 years ago. Updated 2 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Image Cropping
Target version:
Start date:
2015-02-27
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:

Description

I am using following TypoScript to center an image on a specified rectangle.
This will not work after updating to 6.2.10

lib.prodImage = COA
lib.prodImage {
    10 = IMAGE
    10 {
        file = GIFBUILDER
        file {
            format = jpg
            workArea = 0,0,200,200
            XY = 200,200
            backColor = #ffffff
            quality = 95

            10 = IMAGE
            10 {
                file.import.current = 1
                file.maxH = 200
                file.maxW = 200
                align = c,c
            }
        }
    }
}

screen.jpg View (205 KB) Claus Harup, 2015-02-27 16:58


Related issues

Related to TYPO3 Core - Bug #64224: GIFBUILDER with FAL and UTF-8 filesystem Closed 2015-01-09
Related to TYPO3 Core - Bug #62184: Exception using GIFBUILDER in css_styled_content texpic renderer Closed 2014-10-13
Related to TYPO3 Core - Bug #65535: Exception: Serialization of 'Closure' is not allowed Closed 2015-03-05
Related to TYPO3 Core - Bug #65842: Cropping Images in GIFBUILDER is broken since TYPO3 CMS 6.2.10 Closed 2015-03-19
Related to TYPO3 Core - Bug #65925: images are not processed / rendered in TYPO3 V6.2.11!? Closed 2015-03-23
Duplicated by TYPO3 Core - Bug #65599: After Update from 6.2.9 --> 6.2.10 TypoScript Snippet doesn't work anymore Closed 2015-03-08

Associated revisions

Revision ef5f6cc8 (diff)
Added by Torben Hansen over 5 years ago

[BUGFIX] Regression when scaling/cropping in GIFBUILDER

The fix for issue #64224 introduced a regression in GIFBUILDER
resulting in problems with image scaling/cropping.

For $fileInfo and $maskInfo: use 'processedFile' for FAL files
if available and correctly distinguish between FAL- and non-FAL files
otherwise by checking for 'origFile'.

Resolves: #65378
Related: #64224
Releases: master, 6.2
Change-Id: Ib472bdcdc7f814e50ebd18e084f5fbe7d09fc410
Reviewed-on: http://review.typo3.org/37483
Reviewed-by: Stephan Großberndt <>
Tested-by: Stephan Großberndt <>
Reviewed-by: Frans Saris <>
Tested-by: Stefan Froemken <>
Tested-by: Christoph Lehmann <>
Tested-by: Philipp Mueller <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 835be9a8 (diff)
Added by Torben Hansen over 5 years ago

[BUGFIX] Regression when scaling/cropping in GIFBUILDER

The fix for issue #64224 introduced a regression in GIFBUILDER
resulting in problems with image scaling/cropping.

For $fileInfo and $maskInfo: use 'processedFile' for FAL files
if available and correctly distinguish between FAL- and non-FAL files
otherwise by checking for 'origFile'.

Resolves: #65378
Related: #64224
Releases: master, 6.2
Change-Id: Ib472bdcdc7f814e50ebd18e084f5fbe7d09fc410
Reviewed-on: http://review.typo3.org/37533
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision c5b7a0d9 (diff)
Added by Morton Jonuschat about 5 years ago

[BUGFIX] Temporary filename collision in imageMagickConvert()

Add more entropy to the temporary filename used by imageMagickConvert()
to ensure different processing configurations resulting in the same
output dimensions get different temporary names.

In combination with LocalDriver moving the temporary file to a different
location and file_exists_typo3temp_file() having a 30s window where it
doesn't detect the moved file (when the user enabled
$TYPO3_CONF_VARS['GFX']['enable_typo3temp_db_tracking']) this
leads to entries in the sys_processed_file table with a width and
height of 0, thus referencing the original file and resulting in
unscaled images showing in the frontend.

Resolves: #65842
Resolves: #63519
Resolves: #60215
Related: #65378
Releases: 6.2
Change-Id: I42748d0899bf1e24f9f92f2e55802d64309c5704
Reviewed-on: http://review.typo3.org/39373
Reviewed-by: Stephan Großberndt <>
Reviewed-by: Frans Saris <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Geddo no-lastname-given over 5 years ago

same here. I'm using gifbuilder to scale images + watermarks etc. Everything was fine in 6.2.9 and is now messed up in 6.2.10
Here is a test-snippet

page = PAGE
page {
    config {
        no_cache = 1
    }
    10 = IMAGE
    10 {
        file = GIFBUILDER
        file {
            format = jpg
            quality = 90
            XY = 500,500

            10 = IMAGE 
            10 {
                file = fileadmin/template/img/test.jpg
                file.width = 500c # HAS NO EFFECT in 6.2.10!
                file.height= 500c # HAS NO EFFECT in 6.2.10!    
            } 
        }
    }
}

OK folks so here is the deal: https://review.typo3.org/#/c/36180/3/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php

$fileInfo3 gets the correctly scaled, processed image while $fileInfo['originalFile']->getForLocalProcessing(FALSE) delivers the original, unscaled image.
So I don't know why this condition was implemented but at least it should rescale the originalFile like the one in $fileInfo3

#2 Updated by Claus Harup over 5 years ago

I have the same problem with any GIFBUILDER configuration after upgrading to 6.2.10 :-|

#3 Updated by Claus Harup over 5 years ago

Attachment to previous bug....

#4 Updated by Philipp Müller over 5 years ago

Since TYPO3 6.2.10 I've the same problem like Geddo with GIFBUILDER. The problem occurs with width= and height=, too.

I work with:
  • GraphicsMagick 1.3.18 2013-03-10 Q8
  • PHP 5.5.9
  • Ubuntu 14.04.2 LTS.

#5 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 http://review.typo3.org/37483

#6 Updated by Adrian no-lastname-given over 5 years ago

Same here. After upgrading TYPO3 from version 6.2.9 to 6.2.10 the scaling images using GIFBUILDER didn't work. When I'm testing image processing in Instal Tool everything looks ok, byt when I want to change img using GIFBUILDER scaling img didn't work. I'm using GIFBUILDER to adding watermark to yag gallery.

#7 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 http://review.typo3.org/37483

#8 Updated by Gerrit Code Review over 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37483

#9 Updated by Gerrit Code Review over 5 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37483

#10 Updated by Stephan Großberndt over 5 years ago

  • Subject changed from Typo3 6.2.10 Gifbuilder to Scaling/cropping images in GIFBUILDER does not work
  • Target version set to next-patchlevel
  • Complexity set to medium
  • Is Regression changed from No to Yes

This is a regression in TYPO3 CMS 6.2.10 caused by https://review.typo3.org/#/c/36180

#11 Updated by Gerrit Code Review over 5 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37483

#12 Updated by Stephan grass over 5 years ago

Under php 5.4.34 GifBuilder.php will cause the error:

Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /Users/stephangrass/Documents/_Webs_/MR-Chemie/typo3/typo3_src-6.2.10/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php on line 141

#13 Updated by Christian Kuhn over 5 years ago

@Stephan: I can not confirm your "fatal" report (our test environment would also have found that in travis-ci for php 5.4 on 6.2.10)

#14 Updated by Gerrit Code Review over 5 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37533

#15 Updated by Torben Hansen over 5 years ago

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

#16 Updated by Ralph Brugger about 5 years ago

Under php 5.4.34 GifBuilder.php will cause the error:
Same for me wihtin

Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /Users/stephangrass/Documents/_Webs_/MR-Chemie/typo3/typo3_src-6.2.10/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php on line 141

This worked for me: 4 or 5 times in this file:

... GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');

#17 Updated by Christoph Lehmann about 5 years ago

The applied changeset breaks PHP 5.3.10 too

#18 Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

#19 Updated by Simon Schaufelberger 2 months ago

  • Description updated (diff)

Also available in: Atom PDF