[TYPO3-german] dynamische PNGs in Extension erzeugen
Rainer Schleevoigt
rainer at webmasterei-hamburg.de
Mon Mar 23 08:23:11 CET 2009
Hallo,
ich möchte in einem FE-Plugin PNGs aus einer DB generieren.
Hintergrund: „Webseite“ ist FlashSlideshow mit XML-Steuerung.
Ich habe also eine Nichtmenüseite mit folgendem TS angelegt:
=== schnippschnapp==========
img = PAGE
img {
typeNum = 21
10 < plugin.MYEXT_pi1
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:image/png
disableCharsetHeader = 1
disableAllHeaderCode = 1
admPanel = 0
}
}
=== schnippschnapp==========
class tx_MYEXT_pi1 extends tslib_pibase {
var $prefixId = 'tx_MYEXT_pi1'; // Same as class name
var $scriptRelPath = 'pi1/class.tx_MYEXT_pi1.php';
var $extKey = 'MYEXT';
var $pi_checkCHash = true;
function main($content, $conf) {
$im = @ImageCreate (50, 100) or die;
$background_color = ImageColorAllocate ($im, 255, 255, 255);
$text_color = ImageColorAllocate ($im, 233, 14, 91);
ImageString ($im, 1, 5, 5, "Ein Test-String", $text_color);
ob_start();
imagepng($im);
$img = ob_get_contents();
ob_end_clean();
return $img
}
}
Ergebnis:
1. Die Ausgabe besteht nur aus dem HTP-Header
2. Ausgaben von error_log('Test',0), landen nicht im error_log
3. provozierte Fehler im PHP-Script werden im Log protokolliert.
Wo kann ich mich da einlesen oder gibt es eine kurze Antwort was ich
falsch gemacht habe?
More information about the TYPO3-german
mailing list