Bug #76744
closedLazy GIFBUILDER does not scale images in folder _processed_ because they are already processed
100%
Description
Hi
GIFBUILDER does not scale images in folder processed
Fluid
<f:debug>
{f:cObject(typoscriptObjectPath:'lib.ytthumbnail',data:"fileadmin/_processed_/...")}
</f:debug>
TypoScript
lib.ytthumbnail = IMG_RESOURCE
lib.ytthumbnail {
file = GIFBUILDER
file {
XY = 100,100
10 = IMAGE
10 {
file.import.current = 1
file.height = 100
file.maxW = 100
offset = 100-[10.w]/2,100-[10.h]/2
}
}
}
Result: Picture (10 = IMAGE) is cut out and not scaled.
As far as I can figure out, this snipped is used
// If image was processed by GIFBUILDER:
// ($imageResource indicates that it was processed the regular way)
if (!isset($imageResource)) {
$theImage = $tsfe->tmpl->getFileName($file);
if ($theImage) {
$gifCreator = GeneralUtility::makeInstance(GifBuilder::class);
/** @var $gifCreator GifBuilder */
$gifCreator->init();
$info = $gifCreator->imageMagickConvert($theImage, 'WEB');
$info['origFile'] = $theImage;
// This is needed by \TYPO3\CMS\Frontend\Imaging\GifBuilder, ln 100ff in order for the setup-array to create a unique filename hash.
$info['origFile_mtime'] = @filemtime($theImage);
$imageResource = $info;
}
}
5844 sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
As you can see, imageMagickConvert is not called "the-regular-way", $width and $height are missing and so for GIFBUILDER there is nothing to scale.
For example, a "normal" picture in fileadmin:
// all other images
} else {
// the result info is an array with 0=width,1=height,2=extension,3=filename
$result = $gifBuilder->imageMagickConvert(
$originalFileName,
$configuration['fileExtension'],
$configuration['width'],
$configuration['height'],
$configuration['additionalParameters'],
$configuration['frame'],
$options
);
Line 126 sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php
Every media video object thumbnail is place in fileadmin/_processed_, so there are some cases to scale a proccessed pic. For example I want to place a play button on a down-scaled video thumbnail. Workaround:
lib.preprocvid = IMG_RESOURCE
lib.preprocvid {
file = GIFBUILDER
file {
XY = [10.w],[10.h]
backColor = #ffffff
10 = IMAGE
10 {
file.import.current = 1
}
}
}
Convert the video thumbnail into a GB Temp image and scale that picture down.
Updated by Chris Sy over 8 years ago
- % Done changed from 0 to 100
Close this.
Its not possible to resize the picture in GIFBUILDER but you can preresize it with f:uri
{f:uri.image(src: pageMedia.0.uid, width: 500, maxHeight: 300, treatIdAsReference: 1)}