note 28995 added to function.imagejpeg
| From: | adrian at example dot com | Date: | Thu, 30 Jan 2003 00:42:19 +0000 |
| Subject: | note 28995 added to function.imagejpeg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-43098@lists.php.net to get a copy of this message | ||
I am fairly new to PHP, but have done enough C to know my way around the language syntax. MY problem
though, is one of lack of experience with PHP/GD to know what I am doing wrong here.
I am trying to write a page counter that loads predefined jpeg digits as the image resource. but for
some reason I cannot seem to display more than one digit image at any given time in the browser.
What have I overlooked?
A snipet of the vital code is shown below. If anyone has any suggestions I would love to hear them.
Thanks
This is in my HTML file that calls it;
.....previous stuff removed
<body bgcolor="#ffffff">
<img src="scripts/counter.php">
</body>
</html>
This is in my PHP file;
.....file I/O routine left out also
display_count($countVal);
function display_count($count)
{
for ($idx = 1; $idx <= strlen($count); $idx++)
{
$digitValStr = substr($count, $idx, 1);
$digitVal = intval($digitValStr);
$imgFilename = "$digitValStr.jpg";
header("Content-type: image/jpeg");
$digitsImg[$digitVal] = imagecreatefromjpeg($imgFilename);
imagepng($digitsImg[$digitVal]);
imagedestroy($digitsImg[$digitVal]);
}
}
--
http://www.php.net/manual/en/function.imagejpeg.php
http://master.php.net/manage/user-notes.php?action=edit+28995
http://master.php.net/manage/user-notes.php?action=delete+28995
http://master.php.net/manage/user-notes.php?action=reject+28995