Solved

Creating Images without GD

Posted on 2003-11-14
11
360 Views
Last Modified: 2008-03-17
Hello

I have to generate images dynamically for the website I am developping for my company, and I would have liked to make it customizable (colors, layout...)
Therefore, some images have to be generated dynamically so that they fit the layout chosen by the user.

My problem is that I don't have any rights to install graphic libraries like GD for instance, and the administrators won't do it (you know how system admins are in big corporate groups.. don't want to move a finger. "if it works, don't touch it, it will continue to work, don't take the risk to have some work to achieve...")
Many thanks to them, everything has to be done from "scratch" ^^

So, if anyone has already done that, how would it be possible to create images without any lib at all ?
(might sound a HUGE work...)
or has anyone already coded a script for generating quarter-circles without libs, that would be indeed the most important thing i need, the other images could be avoided, but these ones are kinda important (yes, i know, it's lame and takes time to just for obtaining stupid quarter-circles... but tell that to the sheeps who pretend to work there and use the site I have to do. They want the moon, i have to find it)
and yes, i know the latest Mozilla versions have a property to generate round-edged tables, but the so-called sheeps are using IE.

Please help a poor slave slowly becoming mad.

many thanks in advance
0
Comment
Question by:malv42
  • 3
  • 2
  • 2
  • +3
11 Comments
 
LVL 14

Accepted Solution

by:
ThG earned 45 total points
ID: 9749905

I don't think there is someone enough insane to write an image generator from scratch using PHP. GD libs are fine, and you can load them as shared library on almost every installation using the dl() function (the only reason i can think of for not being able to do it is with safe mode.. but fortunately it's not commonly used).
Get the shared library compiled with the same OS/arch of your host provider, upload it, chmod 755 and dl() it in your scripts.
I've never tried this before but I think it works.
0
 
LVL 6

Assisted Solution

by:aolXFT
aolXFT earned 40 total points
ID: 9751269
First of all(unless you are being very well paid for taking such crap) I recommend giving the administrator a rather hard kick, on the backside. GD is fairly stable, and presents no currently known threat to PHP's stability.

As ThG said dl() may be an option. Make sure though you check it out first, two of the main problems with dl(), are safe mode(as ThG said) and the Server Enviornment. As far as I know Zeus, and IIS(multithreaded Servers) have problems with dl().
0
 
LVL 11

Assisted Solution

by:Zontar
Zontar earned 40 total points
ID: 9755634
aolXFT is correct -- at least in IIS, GD (and any other extension)  will need to be turned on in php.ini. Tell your admin he needs to get up off his duff, move php_gd2.dll to the system32 directory, uncomment "extension = php_gd2.dll" in the php.ini file and restart IIS. Surely he can take time out to work for all of 3-4 minutes!

I've used GD on IIS, Apache/Windows, and Apache/Linux and never had any sort of problems with it messing up PHP or the server.

However, if all else should fail, check out www.phpclasses.org -- a search on "image generation" brought up several likely-looking hits. (You will have to join the site to download anything.)

0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:jares
ID: 9758049
changing color scheme? it would be easier to write some CSS files and select new one when user wants to change the scheme. it's as simple as echoing name of a stylesheet as value of <LINK rel="stylesheet">'s src attribute.
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9758308
Didn't you read the question? He really does need some images. Remember, PHBs and such tend not to be satisfied with elegant solutions.

Don't get me wrong -- I'm definitely in the More CSS less Junk camp myself. But pigs is pigs, PHBs is PHBs, and clueless is clueless.

It's particularly clueless if they won't let him run GD.
0
 
LVL 1

Expert Comment

by:spearman123
ID: 9758640
heres what I did
create general images that are transparent.. then use tables and table backgrounds to make the image appear as if it has green background.. but its really transparent.. understand?
0
 
LVL 1

Expert Comment

by:jares
ID: 9758886
Sorry, I didn't understand the question...
0
 
LVL 6

Expert Comment

by:aolXFT
ID: 9759507
From looking at phpclasses.org as suggested by Zontar(thanks for the link - seems like a pretty cool site), I found image_bmp. This works without GD, but it works in Bitmap format.

You may be able to find another class though that converts bitmaps, to another format. If you needed to write your own, you could use http://www.yamasoft.com/php-gif.zip to start you off, if you live somewhere where Unisys don't have a patent(or have a license).
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9759801
I have to warn you, I've found some crap at that site (phpclasses) but I've also found some gems, including an FTP class that came in handy on one server that didn't have the PHP extensions for that enabled, and a PDF-generaiton class that I prefer to the standard extensions.
0
 

Author Comment

by:malv42
ID: 9762334
many thanks for your help guys.

I will try with dl() as you said, but it will (unfortunately) probably be running on IIS, ut I will give it a try.
well, it seems like I will need to talk to my sysadmin (I'll consider your solution in this case aolXFT, it can't be wrong, and for sure it will do him good).

wish me luck, and thanks again everybody
(no real solutions, so I split the points, your advices were quite complementary)
0
 

Author Comment

by:malv42
ID: 9762354
Spearman123 :
I see what you meant, but it's not what I asked for and this wouldn't have helped me, therefore I didn't gave you points (would have been unjustified to lower the points amount of the ones that gave more applicable solutions)

thanks anyway
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MVC - procedural PHP 10 38
Displaying text in text field when clicking on ajax search result 10 39
Log in through ID 5 18
simple html dom php accessing table/cell  values 4 22
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question