Project

General

Profile

Actions

Bug #62184

closed

Exception using GIFBUILDER in css_styled_content texpic renderer

Added by René Pflamm about 10 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Category:
Content Rendering
Target version:
Start date:
2014-10-13
Due date:
% Done:

100%

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

Description

If the default rendering of tt_content.image was modified so an GIFBUILDER is used and an image has an link the system break at the try to run "imageLinkWrap".

Way to reproduce:

  1. Greate an image content element with one or more images
  2. Assign at least one image an link
  3. Put following in your typoscript:
tt_content.image.20.1 {
  file >
  file = GIFBUILDER
  file {
    format = png

    XY = [10.w],[10.h]

    10 = IMAGE
    10.file {
      import.data.cObject = TEXT
      import.data.cObject.data = register:ORIG_FILENAME
      import.data.cObject.wrap = file:|:uid
      treatIdAsReference = 1

      maxW = {$styles.content.imgtext.maxW}
      maxW.override.field = register:maxImageWidth
      maxW.override.override.field = imagewidth
      maxH.override.field = imageheight
    }

    20 = TEXT
    20 {
      text.data.cObject = TEXT
      text.data.cObject.data = register:ORIG_FILENAME
      text.data.cObject.wrap = file:|:copyright

      fontSize = 11
      fontColor = #000000

      offset = 10,17
    }
  }
}

Now open the page and you got following Exception:

#1401732564: Invalid file identifier given. It must be of type string and not empty. "NULL" given. (More information)

InvalidArgumentException thrown in file
/var/www/vhosts/domain.tld/TYPO3/typo3_src-6.2.5/typo3/sysext/core/Classes/Resource/ResourceFactory.php in line 373.

I could fix this issue by adding the following lines to ContentObjectRenderer at line 5231 right after $imageResource = $gifCreator->getImageDimensions($theImage);

$imageResource['origFile'] = $theImage;
$imageResource['originalFile'] = $theImage;

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #65378: Scaling/cropping images in GIFBUILDER does not workClosed2015-02-27

Actions
Actions #1

Updated by Sascha Schieferdecker almost 10 years ago

I have a similar issue with an FCE, guess it's the same Core Problem:

                        10 = IMAGE
                        10.file = GIFBUILDER
                        10.file {
                            XY = 708,450
                            format = jpg
                            10 = IMAGE
                            10.file.import = uploads/tx_templavoila/
                            10.file.import.current = 1
                            10.file.import.listNum = 0
                            10.file.width = 708c
                            10.align = c,c
                            10.altText.field = field_big_alttext
                            10.titleText.field = field_big_alttext
                            20 = TEXT
                            20.text.field = field_big_copyright
                            20.fontFile = fileadmin/templates/gifbuilderfonts/arial.ttf
                            20.fontSize = 9
                            20.fontColor.field = field_copyright_color_big
                            20.offset = 3,446
                            treatIdAsReference = 1
                        }

                        10.imageLinkWrap = 1
                        10.imageLinkWrap.enable = 1
                        10.imageLinkWrap.typolink.parameter.field = field_link
                        10.imageLinkWrap.if.isTrue.field=field_link

                        10.altText.field = field_big_alttext    
                        10.titleText.field = field_big_alttext                        
                        10.if.value.field = field_align_image_big
                        10.if.equals = cc

Uncaught TYPO3 Exception
#1401732564: Invalid file identifier given. It must be of type string and not empty. "NULL" given. (More information)

InvalidArgumentException thrown in file
/var/websites/ol_stadtmuseum/site/typo3/sysext/core/Classes/Resource/ResourceFactory.php in line 373.

50 TYPO3\CMS\Core\Resource\ResourceFactory::getFileObjectFromCombinedIdentifier(NULL)

/var/websites/ol_stadtmuseum/site/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php:
01470: $file = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileObject((int)$imageFile);
01471: } else {
01472: $file = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileObjectFromCombinedIdentifier($imageFile);
01473: }
01474: }

49 TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::imageLinkWrap("<img src="typo3temp/GB/_c__Domininghaus_csm_708x45…. Högl, um 1810. Foto: Gerlinde Domininghaus" />", NULL, array)

Actions #2

Updated by Michael Ganner almost 10 years ago

I got the same Exception when setting imageLinkWrap to true in the TS below. T3 Version 6.2.9

file = GIFBUILDER
        file{
          format = jpg
          quality = 100
          XY = 300,185
          10 = IMAGE
          10{
            offset = 0,0

            file = fileadmin/templates/placeholder_contmenu.png

            file.import=uploads/media/
            file.import.field=media
            file.import.override.field = media
            file.import.listNum=0
          }
          #10.file.width=300
          #10.file.height=185c
        }

        params = class="" 
        #altText.field=title
        altText.field=abstract//title
        altText.crop=130|...|1
        #titleText.field=title
        imageLinkWrap=0
        imageLinkWrap {
          enable=1
          typolink.parameter.data=field:uid
          typolink.title.field=title
        }
Actions #3

Updated by Gerrit Code Review over 9 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/37158

Actions #4

Updated by Xavier Perseguers over 9 years ago

  • Assignee set to Xavier Perseguers
  • PHP Version set to 5.6
  • Sprint Focus set to Stabilization Sprint
Actions #5

Updated by Gerrit Code Review over 9 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/37158

Actions #6

Updated by Stephan Großberndt over 9 years ago

  • Subject changed from Excention when use GIFBUILDER in css_styled_content texpic renderer to Exception using GIFBUILDER in css_styled_content texpic renderer
Actions #7

Updated by Daniel Wagner over 9 years ago

One installation produced the same exception without GIFBUILDER but with imageLinkWrap.
Maybe we have problem with imageLinkWrap? it works if I set imageLinkWrap = 0.

poiImage = IMAGE
poiImage {
file.maxW = 80
file.maxH = 80
imageLinkWrap = 1
imageLinkWrap {
enable = 1
width = 1000m
height = 800
}
}

Actions #8

Updated by Xavier Perseguers over 9 years ago

  • Target version set to 6.2.12
Actions #9

Updated by Gerrit Code Review over 9 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/37158

Actions #10

Updated by Gerrit Code Review over 9 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/38665

Actions #11

Updated by Xavier Perseguers over 9 years ago

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

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF