Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

Creating Images without GD

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
malv42
Asked:
malv42
  • 3
  • 2
  • 2
  • +3
3 Solutions
 
ThGCommented:

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
 
aolXFTCommented:
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
 
ZontarCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
jaresCommented:
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
 
ZontarCommented:
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
 
spearman123Commented:
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
 
jaresCommented:
Sorry, I didn't understand the question...
0
 
aolXFTCommented:
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
 
ZontarCommented:
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
 
malv42Author Commented:
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
 
malv42Author Commented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now