By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,050 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,050 IT Pros & Developers. It's quick & easy.

[Q] Image Creation problems & MacOSX

P: n/a
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... ===
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Eric" <eg*************@verizon.net> wrote in message
news:1g336tc.bkzouq19keddcN%eg*************@verizo n.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.
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.