473,624 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[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_col or = imagecoloralloc ate ($im, 255, 255, 255);
$text_color = imagecoloralloc ate ($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 1771

"Eric" <eg************ *@verizon.net> wrote in message
news:1g336tc.bk zouq19keddcN%eg *************@v erizon.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
3029
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 image: http://indicator.amessage.info/indicator.php?param1=cobnet%40jabber.org&amp;param2=bounce&amp;param3=http%3A%2F%2Fstudent.ugent.be%2Fastrid%2Fpics%2Fjabber%2F&amp;param4=.png
7
1714
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. My page (draw_pie.php) that draws the pie chart works as it should and I link to it like this ... <A HREF="draw_pie.php?a='.$a.'&b='.$b.'&c='.$c.'&d='.$d.'&e='.$e.'&f='.$f.'&g=' ..$g.'&h='.$h.'">Pie Chart</A>
8
2606
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) stuff. The class will behave like a std::vector (copy constructor and assignment create a deep copy), but with 2D indexing. Now I also need a 'view' class that will behave like a reference to an 'image' (can only be constructed from an existing...
7
1576
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- #include virtual=) in every web page. References in navigation_bar.txt that work on the web host, like
1
1858
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 (compiled from source) gd 2.0.28 (came with php)
5
4387
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' print 'Content-type: text/html' print print '<HTML><HEAD><TITLE>Python Dynamic Image Creation Test</TITLE></HEAD>'
8
3028
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 script). However I note that the image creation is quite slow - the user can see that the image is created line-by-line, from top to bottom. Most likely this speed issue comes from PHP, since PHP is simply slower than C etc.
6
2224
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 below that, hope you can help. <?xml version='1.0' encoding='utf-8' ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" encoding="ISO-8859-1" omit-xml-declaration="yes"/>
1
2016
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 and after displayed it.plz tell that how to start the logic. <?php // Connect to database $errmsg = "";if (! @mysql_connect("localhost","root","sreeni")) { $errmsg = "Cannot connect to database"; } @mysql_select_db("my_db1");...
1
8334
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.