Solved

Creating Images without GD

Posted on 2003-11-14
11
355 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
Comment Utility

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
Comment Utility
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
Comment Utility
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
 
LVL 1

Expert Comment

by:jares
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Expert Comment

by:spearman123
Comment Utility
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
Comment Utility
Sorry, I didn't understand the question...
0
 
LVL 6

Expert Comment

by:aolXFT
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now