# Dynamic Image Editing?



## martinatkinson (Mar 18, 2002)

Hey guys!

I have a tough question.  I am making a site and I would like to have a CGI script or whatever is needed to be able to dynamically edit the content of an image.

OK, I have the button and what I would like to do is access:

http://www.MYSITE.com/images/MYIMAGE.png?text=My Button Text

When this URL is accessed it would display the button with the text "My Button Text" or whatever was typed in place of that.

I have seen this done on other sites does anyone here know how I would do this or could provide me a link to a script that would allow this?

Thanks!

Albert


----------



## putamare (Apr 2, 2002)

It isn't that hard if you already know php which isn't that hard if you already know perl. If you're feeling full of beans a good place to start would be here and here. If a printed manual is more your style, there is a chapter on generating graphics in Visual Quickpro Advanced PHP. The main hurdle is fonts, if you install Xfree86 & such you should be able to access those fonts as described on the php site, but incorporating the Mac fonts is a problem I haven't had the time to confront (a ten foot pole that nobody seems quite ready to touch).


----------



## bighairydog (Apr 2, 2002)

Like this one?

It's an aqua button, but the image behind the text is variable.

It's on Marc Liyanage's site, which is where I get all my PHP / MySQL binaries

Bernie     )


----------



## martinatkinson (Apr 3, 2002)

Hello!

I am writing this post on a Dell right now and that image showed up fine.  Looks like what I want, problem is that when I tried to access it using Internet Explorer 5.1 for my Mac it did not know how to handle it, any idea why?  Also, if I did
	
	



```
<img src="http://www.entropy.ch/software/macosx/php/button-image.php?%20text=Home"><br><br><img src="http://www.entropy.ch/software/macosx/php/button-image.php?%20text=About Us">
```
would this work?

Have a great day!

Albert


----------



## putamare (Apr 3, 2002)

Could it be a png thing? Since php uses open source libraries to generate images, the gif file format was abandoned becase of LZW patent issues. The image works just fine for me in X, but I've read that some people have problems viewing png files.


----------



## bighairydog (Apr 4, 2002)

In the source file, change the code reading:
	
	



```
# That's it, output the result
#
header("Content-Type: image/png");
ImagePng($img_out);
```
So that the last two lines of that clipping are
	
	



```
header("Content-Type: image/jpeg");
ImageJPEG($img_out);
```
or
	
	



```
header("Content-Type: image/gif");
ImageGIF($img_out);
```
Which produces a JPEG or a GIF image respectively.

Bernie     )


----------



## Iolaire (Jan 5, 2003)

Someone was asking why they could not view the PNG on IE for the mac, just go to Preferences - File Helpers and customize the PNG options, at the bottom select: Handling view with browser.

That was a simple answer for a irritating problem!
iolaire


----------

