GD2 - doesn't show all of source image.
| From: | Joe Hill | Date: | Tue, 11 May 2004 08:19:33 +0000 |
| Subject: | GD2 - doesn't show all of source image. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-185885@lists.php.net to get a copy of this message | ||
Hi All
There are two machines, one is running PHP 4.3.0 and the other PHP
4.1.2, both also have GD2. Both are running on Linux systems.
On the 4.3.0 machine, running a simple PHP script (at bottom of email,
for reference) works fine - the whole image shows, and the text is
also shown. This is what is expected.
However, on the 4.1.2 machine, only "so much" of the picture is shown.
I have tried using different pictures, and they all, depending on the
size of the JPEG image, show different amounts on the 4.1.2 machine -
but never a complete image.
It appears to me, that PHP/GD is loading only -so- many bytes of the
image on my 4.1.2 setup.
Does anyone have any ideas what might be wrong?
Joe
SCRIPT I'M USING:
------------------------------------
<?
header ("Content-type: image/jpeg");
$string = date("Y"."m"."d"."H"."i"."s");
$font = 4;
$width = ImageFontWidth($font)* strlen($string) ; $height =
ImageFontHeight($font) ;
$im = ImageCreateFromjpeg("./2.jpeg");
$x=imagesx($im)-$width ;
$y=imagesy($im)-$height;
$background_color = imagecolorallocate ($im, 255, 255, 255); //white
background $text_color = imagecolorallocate ($im, 0, 0,0);//black text
imagestring ($im, $font, $x, $y, $string, $text_color);
imagejpeg ($im);
?>