Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Creating Images without GD

Posted on 2003-11-14
11
Medium Priority
?
366 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +3
11 Comments
 
LVL 14

Accepted Solution

by:
ThG earned 180 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 160 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 160 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

715 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