|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
semondts Smarty n00b
Joined: 07 Aug 2003 Posts: 2 Location: Cologne, Germany
|
Posted: Thu Aug 07, 2003 9:14 am Post subject: Problems with dynamic images |
|
|
Even if I put the following image into a smarty-template, I got problems.
<img src="headline_image.php?text={$titel_1_text}&color=255_0_102" width="319" height="28" border="0">
Sometimes the template in which this image lies will be displayed correct, sometime not. Even if the image is in an if-statement which doesn't match the error occurs {if "a" eq "b"}.
This only happens if "headline_image.php" is not empty. If it is empty, everything works fine.
Here is the content og "headline_image.php":
<?
$font_path="/www/ttf/";
$size = 21;
$fontname = $font_path."t035013d.ttf";
$text = $_GET["text"];
$COLOR = explode("_", $_GET["color"]);
$im = imagecreate(319,27);
$white=imagecolorallocate($im,255,255,255);
$color=imagecolorallocate($im,$COLOR[0],$COLOR[1],$COLOR[2]);
imagettftext($im, $size, 0, 0, 21, $color, $fontname, $text);
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
?>
If "headline_images.php" ist like
<?
?>
everything is ok.
This only happens if smarty is used. In normal HTML-Files the error never occurs.
Does anybody know what to do?
Bye,
Sascha |
|
Back to top |
|
semondts Smarty n00b
Joined: 07 Aug 2003 Posts: 2 Location: Cologne, Germany
|
Posted: Thu Aug 07, 2003 9:31 am Post subject: Strange - additional informations |
|
|
Removing the following lines from the script "headline_images.php" fix the problem:
$white=imagecolorallocate($im,255,255,255);
$color=imagecolorallocate($im,$COLOR[0],$COLOR[1],$COLOR[2]);
imagettftext($im, $size, 0, 0, 21, $color, $fontname, $text);
But this could not be the solution, because now "headline_images.php" won't work correct.
Why does smarty isn't able to work with this construction? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|