Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Problems with dynamic images

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
semondts
Smarty n00b


Joined: 07 Aug 2003
Posts: 2
Location: Cologne, Germany

PostPosted: Thu Aug 07, 2003 9:14 am    Post subject: Problems with dynamic images Reply with quote

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
View user's profile Send private message Visit poster's website
semondts
Smarty n00b


Joined: 07 Aug 2003
Posts: 2
Location: Cologne, Germany

PostPosted: Thu Aug 07, 2003 9:31 am    Post subject: Strange - additional informations Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP