php - \TYPO3\CMS\Frontend\Imaging\Gifbuilder 未生成图像
问题描述
我正在尝试GIFBUILDER
与 php 一起使用,但没有生成图像。
这是我的 php 代码,基于 GifBuilder.php 中的示例
public function gifBuilder(array $fileArray)
{
$gifCreator = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Imaging\Gifbuilder::class);
$gifCreator->init();
$theImage ='';
if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib']) {
$gifCreator->start($fileArray, $this->data);
$theImage = $gifCreator->gifBuild();
error_log("Setup: ".var_export($theImage, true),0);
}
// return $gifCreator->getImageDimensions($theImage);
return $theImage;
}
我对示例代码有疑问。我不明白为什么返回值应该是“getImageDimension”?我将其更改为$theImage
,因为我认为这应该是生成的图像。
但无论如何,不会生成图像。
这里$fileArray
, 发送到函数:
[16-Nov-2020 20:10:25 Europe/Berlin] Config: array (
'file' => 'typo3conf/ext/imagetext/Resources/Public/Images/Plattenteller.jpg',
'file.' =>
array (
'maxW' => 200,
'maxH' => 200,
),
)
我也用这个数组试过:
[16-Nov-2020 20:09:29 Europe/Berlin] Config: array (
'file' => 'GIFBUILDER',
'file.' =>
array (
'format' => 'jpg',
'XY' => '3157,1929',
'width' => '500',
1 => 'IMAGE',
'1.' =>
array (
'file' => 'typo3conf/ext/imagetext/Resources/Public/Images/Plattenteller.jpg',
),
4 => 'CROP',
'4.' =>
array (
'crop' => '400,400,1000,1000',
),
5 => 'SCALE',
'5.' =>
array (
'width' => '400',
),
10 => 'TEXT',
'10.' =>
array (
'text' => 'Country-Musik',
'offset' => '5,30',
'fontColor' => 'yellow',
'fontSize' => '20',
'niceText' => '1',
),
),
)
但是两个数组都不会创建输出。
我希望有人能帮助我!
编辑:
我正在使用 Typo V9.5.22
CROP 的第二个例子我已经开始使用 Typoscript。
解决方案
推荐阅读
- java - 如何从另一个位置添加 textView 的第二行
- python - 使用 pandas 计算一天中的事件持续时间
- python - 绘制象限图以根据 X 和 Y 的平均值区分 4 组中的人口并找到最终计数
- python - 试图通过 selenium 抓取但不能遍历动态内容
- spring-boot - Spring Security:使用域逻辑进行授权
- bash - Cannot write pipe character | in IntelliJ Terminal
- flutter - 当我使用带有标头授权令牌的颤振 http 库时,它在控制台中显示 500。但在邮递员中一切都好
- amazon-web-services - Terraform + GithubActions
- javascript - 使用 gtag 同意模式退出 Google Analytics(分析)
- nginx - nginx 文档在提到兆字节、千兆字节等时是使用 SI 还是非 SI 单位?