Hallo,
ich habe einen Hook gebastelt, der mir bei bedarf noch eine Caption auf das Bild rendert. Soweit sogut.
class tx_dlfunkhaus_tslib_cObj implements tslib_cObj_getImgResourceHook {
/**
* (non-PHPdoc)
* @see tslib_cObj_getImgResourceHook::getImgResourcePostProcess()
*/
public function getImgResourcePostProcess($file, array $configuration, array $imageResource, tslib_cObj $parent){
if( $configuration['caption'] ){
$fileArray = array(
'XY' => sprintf("%d,%d",$imageResource[0], $imageResource[1]+20),
'format' => 'png',
'quality' => '100',
'backColor' => '#FFFFFF',
'10' => 'IMAGE',
'10.' => array("file" => $imageResource[3]),
'15' => "TEXT",
'15.' => array(
"text" => $configuration['caption'],
"fontColor" => "#000",
"fontSize" => "12",
"offset" => sprintf("%d,%d",10,$imageResource[1]+15 ),
)
);
/*15 = IMAGE
15.offset = 420,18
15.file = fileadmin/overlay.png
15.mask = fileadmin/mask.png
# 15.mask = fileadmin/mask_i.png
*/
$gifCreator = t3lib_div::makeInstance('tslib_gifbuilder');
/* @var $gifCreator tslib_gifbuilder */
$gifCreator->init();
$theImage = '';
if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib']) {
$gifCreator->start($fileArray, $this->data);
$theImage = $gifCreator->gifBuild();
}
$imageResource = $gifCreator->getImageDimensions($theImage);
}
return $imageResource;
}
}
So das funktioniert auch alles soweit. Jetzt habe ich versucht TYPO3 beizubringen den Namen aus DAM auszulesen und diesen direkt ins Bild zu rendern. Klappt auch fast...
### DAM Meta data ###
tt_content.image.20.renderMethod = figure
tt_content.image.20.1.file.caption = TEXT
tt_content.image.20.1.file.caption.text.data = field : txdam_copyright
Jetzt bekomme ich auf das Bild immer den String "TEXT" gerendert und nicht das Ergebnis der eigentlichen Abfrage. Es wird immer ein String nie das komplette Array in der Konfiguration übergeben.
Ich habe viel gesucht, bin aber auf nichts passendes gestoßen. Vielleicht hat ja jemand eine Idee.
Gruß
Christian