473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

[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... ===
Jul 17 '05 #1
1 1759

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Mattias Campe | last post by:
Hi, Depending on if I get an image or a text of a certain URL, I want to do something different. I don't know in advance whether I'll get an image or a text. This is a URL that returns an...
7
by: Paul Charlton-Thomson | last post by:
Hi! I have nearly cracked this and am stuck on the last bit. I am asking my visitors to rank 8 different items (a,b,c,d,e,f,g,h) from 1 to 10 and then I want to draw a pie chart of those values....
8
by: Jef Driesen | last post by:
I'm implementing some image processing algorithms in C++. I created a class called 'image' (see declaration below), that will take care of the memory allocations and some basic (mathematical)...
7
by: Eric | last post by:
Goal: Have a (nearly) equivalent website on a local machine (running MacOSX) to what exists on the web host Problem: I have a file call navigation_bar.txt which is included (via SSI-...
1
by: awaegel | last post by:
Hello, I've been running php/apache/etc locally on my powerbook for a long time, but am having problems activating freetype with a new version of php. I'm using: php 4.4.0 freetype 2.1.10...
5
by: Tompa | last post by:
Hi, I would like to create images on the fly as a response to an http request. I can do this with PIL like this (file create_gif.py): from PIL import Image, ImageDraw print 'Status: 200 OK'...
8
by: Alexander Fischer | last post by:
Hello, I am writing a gallery script and use imagecreatefromjpeg and fpassthru to output images without any change to them (i.e., no thumbnail creation etc. - just deliver the image via the php...
6
by: googletired | last post by:
Hello, I haven't made a XSL in quite sometime so i am very rusty. Basicly i want the XSL to display a defined image if one is not present in the XML. here is my current XSL and XML will be...
1
by: sravani1 | last post by:
This code runs like when i submit the form it takes the image and displayed and top of the image a map will displayed. But actually i want that when i give the image it checks the location in the map...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.