note 30398 added to function.imagecreatefromjpeg
| From: | karunakar at indinfotech dot com | Date: | Mon, 17 Mar 2003 05:29:11 +0000 |
| Subject: | note 30398 added to function.imagecreatefromjpeg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45402@lists.php.net to get a copy of this message | ||
Hello friends,
I need some clarification. I am using the below code for PNG images , its working fine but. when i
use code for jpeg and gif images its giving the following error. Is that only some functions of GD
enabeled and other not. is it possible ?
<?php
header ("Contenttype: image/png");
$im = @ImageCreate (50, 100)
or die ("Cannot create a new GD image.");
$background_color = ImageColorAllocate ($im, 255, 255, 255);
$text_color = ImageColorAllocate ($im, 233, 14, 91);
ImageString ($im, 1, 5, 5, "A Simple Text String", $text_color);
ImagePng ($im);
?>
--- Works fine ----
<?php
header('Content-Type: image/jpeg');
$img = imagecreatefromjpeg ("upload/163_CURVE.jpg"); /* Attempt to open */
$white=ImageColorAllocate($img,255,255,255);
$char="o";
$height=ImageFontHeight(5);
ImageCharUp($img,$height,45,50,$char,$white);
ImageRectangle($img,52,70,270,170,$white);
ImageArc($img,52,70,70,70,0,360,$white);
imagejpeg($img);
?>
---- Gives following ERROR ---
<br>
<b>Warning</b>: ImageCreateFromJpeg: No JPEG support in this PHP build in
<b>/home/sites/aeryindiinfotech/www/createimage.php</b> on line
<b>4</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in
<b>/home/sites/aeryindiinfotech/www/createimage.php</b> on line
<b>5</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in
<b>/home/sites/aeryindiinfotech/www/createimage.php</b> on line
<b>8</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in
<b>/home/sites/aeryindiinfotech/www/createimage.php</b> on line
<b>9</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in
<b>/home/sites/aeryindiinfotech/www/createimage.php</b> on line
<b>10</b><br>
<br>
<b>Warning</b>: ImageJpeg: No JPG support in this PHP build in
<b>/home/sites/aeryindiinfotech/www/createimage.php</b> on line
<b>12</b><br>
--- End of ERROR--
<?php
header('Content-Type: image/gif');
$img = imagecreatefromgif ("upload/search.gif");
$white=ImageColorAllocate($img,255,255,255);
$char="o";
$height=ImageFontHeight(5);
ImageCharUp($img,$height,45,50,$char,$white);
ImageRectangle($img,52,70,270,170,$white);
ImageArc($img,52,70,70,70,0,360,$white);
imagegif($img);
?>
---- GIVES FOLLOWING ERROR--
<br>
<b>Warning</b>: ImageCreateFromGif: No GIF support in this PHP build in
<b>/home/sites/aeryindiinfotech/www/createimage1.php</b> on line
<b>5</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in
<b>/home/sites/aeryindiinfotech/www/createimage1.php</b> on line
<b>6</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in
<b>/home/sites/aeryindiinfotech/www/createimage1.php</b> on line
<b>9</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in
<b>/home/sites/aeryindiinfotech/www/createimage1.php</b> on line
<b>10</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in
<b>/home/sites/aeryindiinfotech/www/createimage1.php</b> on line
<b>11</b><br>
<br>
<b>Warning</b>: ImageGif: No GIF support in this PHP build in
<b>/home/sites/aeryindiinfotech/www/createimage1.php</b> on line
<b>12</b><br>
Need some Help..
--
http://www.php.net/manual/en/function.imagecreatefromjpeg.php
http://master.php.net/manage/user-notes.php?action=edit+30398
http://master.php.net/manage/user-notes.php?action=delete+30398
http://master.php.net/manage/user-notes.php?action=reject+30398