|
|
[Q] Image Creation problems & MacOSX
I've got a fairly simple php script which creates a simple gif image.
Now, if I use this script on my primary webhost, everything works
correctly and the image is created.
However, I would also like to see it working on my local machine and in
this case, I just get back the standard broken image icon.
I am guessing something is not configured properly, but I am uncertain
as to what that might be.
Does anyone have any ideas?
Here's the php script...
<?php
header ("Content-type: image/gif");
$im = imagecreate (50, 100);
$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);
imagegif ($im);
imagedestroy ($im);
?>
--
== Eric Gorr ========= http://www.ericgorr.net ========= ICQ:9293199 ===
"Therefore the considerations of the intelligent always include both
benefit and harm." - Sun Tzu
== Insults, like violence, are the last refuge of the incompetent... ===
|
|
0
|
|
|
|
Reply
|
egDfAusenetE5fz (78)
|
10/19/2003 9:23:54 PM |
|
"Eric" <egDfAusenetE5fz@verizon.net> wrote in message
news:1g336tc.bkzouq19keddcN%egDfAusenetE5fz@verizon.net...
> I've got a fairly simple php script which creates a simple gif image.
> Now, if I use this script on my primary webhost, everything works
> correctly and the image is created.
>
> However, I would also like to see it working on my local machine and in
> this case, I just get back the standard broken image icon.
>
It sounds like the version of GD on your remote host (your primary host)
differs to what you have on your local machine.
I suggest two things... First, compare the GD section in a phpinfo(); output
on both your servers and secondly, compare the output of the following:
<?
$gdinfo=gd_info();
for($gdinfo as $key=>$value)
{ print("<br>$key = $value");
}
?>
GIF support under GD was removed because GIF is under patent by Unisys. I
believe this patent has expired in the US, but has one year to go worldwide
ex-usa and the programmer (a chap by the name of Boutell) did not want to
risk breaking laws, he disabled support for GIF creation until July next
year.
Thus... I think your remote server is using an older version of PHP (which
has GD built in - I believe, version 1.6) whereas your newer, local server
probably has a newer version of PHP (which has GD version 2 builtin, which
lacks the GIF write support).
You could instead create PNG type files which are similar to GIF (some say
smaller) and are supported by all web browsers. PNG I believe stands for
Portable Network Graphics and does not have the legal problems currently
being experienced with GIF.
|
|
0
|
|
|
|
Reply
|
you.can.email.me (4)
|
10/20/2003 6:47:32 AM
|
|
|
1 Replies
27 Views
(page loaded in 0.048 seconds)
|
|
|
|
|
|
|
|
|