Categories
Original

New version of rgba.php is out!

It’s been a while since I posted my little server-side solution for cross-browser RGBA colors (in a nutshell: native rgba for the cool browsers that support it, a PHP-generated image for those that don’t). For features, advantages, disadvantages etc, go see the original post. In this one I’ll only discuss the new version.

So, since it’s release I’ve received suggestions from many people regarding this script. Some other ideas were gathered during troubleshooting issues that some others faced while trying to use it. I hope I didn’t forget anything/anyone 🙂

Changelog (+credits):

  1. You may now specify the size of the generated image (thanks Sander Arts!)
  2. If the PHP version is below 5.1.7 the call to imagepng() uses 2 parameters instead of 4, to workaround the bug found by Bridget (thanks Chris Neale for suggesting the use of phpversion()!)
  3. Added error_reporting() to only allow for fatal errors and parse errors to go through (I should had done this anyway but I completely forgot). This solves an issue that Erin Doak pointed out, since they had set up notices to be displayed and even a reference to an undefined index made the whole script collapse.
  4. Mariotti Raffaele pointed out that apache_request_headers() was not defined in all PHP installations. After looking into it a bit, I found out that it’s available only when PHP is installed as an Apache module. After some more research it turned out that the only way to get the If-Modified-Since header otherwise is an .htaccess, so I  ruled that out (It would complicate the workaround I think and I doubt all hosts allow .htaccess (?). On the other hand, an .htacess would also allow for some URL rewriting goodness… Hmmm… Should I consider this?). So, if the function is not available, it serves the file with an 200 response code every time, instead of just sending a 304 response when the If-Modified-Since header is present.
  5. Igor Zevaka for pointing out that the Expires header wasn’t a valid HTTP date.

Links

rgba.php

Demo

Enjoy 🙂 and please report any bugs!

1,405 replies on “New version of rgba.php is out!”

Oh lea, u drive me crazy! That is a greate tool and to say the truth, i have missed it when u first posted it.

Combining it with a good UI, it can be easilly used for option templates to WordPress (sorry, but i am wp addicted :P)

Thanks, Lea! I was having trouble with the old script (it would break after initially loading… I think related to undefined apache_request_headers() as you pointed out). This cleared everything up. RGBA in IE the easy way… makes me very happy!

Thanks for this!

Also, why don’t you allow for urls like this?: rgba.php?1,2,3,4

I don’t think these would have to be urlencoded, and it would be easier to read.

Only thing about this that i find slightly confusing.. is that say you use

background: url(rgba.php?color_r=46&g=46&b=50&a=30) repeat;
background: rgba(46,46,50, 0.3);

They end up being 2 totally different colours.. so its hard to get the right combination to keep the same colours using the 2 methods..

Yeah, the color_ part was unnecessary and you ended up not specifying r this way.

By the way, one feature I’d like to implement in the next version is making the syntax more similar to the CSS one, like rgba.php/rgba(46,46,50,0.3) instead of rgba.php?r=46&g=46&b=50&a=30

Title

[…]we like to honor numerous other world-wide-web internet sites on the web, even if they aren’t linked to us, by linking to them. Beneath are some webpages worth checking out[…]

Title

[…]Wonderful story, reckoned we could combine several unrelated data, nevertheless definitely worth taking a appear, whoa did a single study about Mid East has got additional problerms too […]

Title

[…]we prefer to honor several other internet web sites around the net, even though they aren’t linked to us, by linking to them. Below are some webpages really worth checking out[…]

Title

[…]very couple of internet sites that occur to become in depth below, from our point of view are undoubtedly properly worth checking out[…]

Title

[…]although internet sites we backlink to below are considerably not associated to ours, we really feel they are truly really worth a go through, so possess a look[…]

Title

[…]Wonderful story, reckoned we could combine a couple of unrelated data, nevertheless seriously really worth taking a appear, whoa did one understand about Mid East has got far more problerms too […]

Title

[…]Wonderful story, reckoned we could combine a few unrelated data, nevertheless definitely worth taking a look, whoa did 1 study about Mid East has got additional problerms as well […]

Title

[…]we like to honor many other online websites on the web, even when they aren’t linked to us, by linking to them. Below are some webpages worth checking out[…]

Title

[…]Wonderful story, reckoned we could combine a few unrelated information, nevertheless genuinely worth taking a look, whoa did a single learn about Mid East has got more problerms too […]

Title

[…]we like to honor quite a few other internet internet sites around the internet, even if they aren’t linked to us, by linking to them. Under are some webpages worth checking out[…]

Title

[…]Wonderful story, reckoned we could combine a number of unrelated information, nevertheless genuinely worth taking a search, whoa did a single master about Mid East has got a lot more problerms at the same time […]

Title

[…]although internet websites we backlink to beneath are considerably not related to ours, we really feel they are in fact really worth a go by way of, so have a look[…]

Title

[…]just beneath, are many totally not related internet sites to ours, on the other hand, they’re surely really worth going over[…]

Title

[…]Wonderful story, reckoned we could combine several unrelated information, nevertheless truly worth taking a search, whoa did a single master about Mid East has got much more problerms at the same time […]

Title

[…]Wonderful story, reckoned we could combine a couple of unrelated information, nevertheless truly worth taking a appear, whoa did one discover about Mid East has got additional problerms at the same time […]

Title

[…]we prefer to honor several other net web-sites on the internet, even though they aren’t linked to us, by linking to them. Below are some webpages worth checking out[…]

Title

[…]very couple of internet sites that come about to be comprehensive beneath, from our point of view are undoubtedly well really worth checking out[…]

Title

[…]Wonderful story, reckoned we could combine a couple of unrelated information, nevertheless genuinely worth taking a search, whoa did 1 understand about Mid East has got much more problerms also […]

Title

[…]although internet sites we backlink to below are considerably not connected to ours, we feel they may be basically really worth a go as a result of, so have a look[…]

Title

[…]Wonderful story, reckoned we could combine a handful of unrelated information, nevertheless seriously really worth taking a appear, whoa did one particular discover about Mid East has got extra problerms also […]

Title

[…]although sites we backlink to below are considerably not associated to ours, we really feel they are in fact really worth a go by means of, so possess a look[…]

Title

[…]very couple of web-sites that happen to become comprehensive beneath, from our point of view are undoubtedly effectively really worth checking out[…]

Title

[…]that would be the finish of this write-up. Here you’ll discover some internet sites that we think you’ll appreciate, just click the links over[…]

Title

[…]Wonderful story, reckoned we could combine a handful of unrelated data, nevertheless actually worth taking a look, whoa did a single find out about Mid East has got additional problerms as well […]

Title

[…]just beneath, are quite a few completely not associated web-sites to ours, on the other hand, they’re certainly worth going over[…]

Title

[…]Wonderful story, reckoned we could combine a couple of unrelated information, nonetheless really worth taking a search, whoa did 1 master about Mid East has got far more problerms as well […]

Title

[…]although internet websites we backlink to below are considerably not related to ours, we feel they are basically really worth a go as a result of, so have a look[…]

Title

[…]Wonderful story, reckoned we could combine several unrelated data, nevertheless seriously really worth taking a look, whoa did one particular discover about Mid East has got a lot more problerms also […]

Title

[…]Wonderful story, reckoned we could combine a few unrelated information, nonetheless really really worth taking a search, whoa did one particular understand about Mid East has got additional problerms also […]

Title

[…]Wonderful story, reckoned we could combine a couple of unrelated information, nevertheless definitely really worth taking a look, whoa did a single understand about Mid East has got much more problerms also […]

Title

[…]Wonderful story, reckoned we could combine a number of unrelated data, nonetheless definitely really worth taking a look, whoa did one particular master about Mid East has got far more problerms at the same time […]

Title

[…]Wonderful story, reckoned we could combine a few unrelated information, nevertheless really really worth taking a search, whoa did one particular understand about Mid East has got more problerms also […]

Title

[…]we like to honor numerous other web web-sites on the net, even though they aren’t linked to us, by linking to them. Underneath are some webpages really worth checking out[…]

Title

[…]Wonderful story, reckoned we could combine a number of unrelated information, nonetheless really really worth taking a appear, whoa did a single discover about Mid East has got more problerms as well […]

Title

[…]Wonderful story, reckoned we could combine a number of unrelated information, nevertheless truly worth taking a search, whoa did a single study about Mid East has got much more problerms at the same time […]

Title

[…]Wonderful story, reckoned we could combine a few unrelated data, nevertheless really worth taking a appear, whoa did one particular discover about Mid East has got much more problerms as well […]

Title

[…]although internet websites we backlink to beneath are considerably not connected to ours, we feel they may be essentially really worth a go as a result of, so have a look[…]

Title

[…]Wonderful story, reckoned we could combine a couple of unrelated data, nonetheless actually worth taking a search, whoa did 1 study about Mid East has got extra problerms also […]

Title

[…]although internet websites we backlink to below are considerably not related to ours, we feel they are actually really worth a go through, so possess a look[…]

Title

[…]we like to honor a lot of other internet web sites around the net, even when they aren’t linked to us, by linking to them. Beneath are some webpages really worth checking out[…]

Title

[…]we like to honor quite a few other world-wide-web websites on the net, even though they aren’t linked to us, by linking to them. Below are some webpages really worth checking out[…]

Title

[…]Wonderful story, reckoned we could combine several unrelated information, nevertheless definitely really worth taking a appear, whoa did one find out about Mid East has got far more problerms at the same time […]

Title

[…]although internet sites we backlink to below are considerably not connected to ours, we really feel they are in fact really worth a go by means of, so have a look[…]

Title

[…]Wonderful story, reckoned we could combine a number of unrelated data, nonetheless really worth taking a appear, whoa did one particular study about Mid East has got additional problerms too […]

Title

[…]although web sites we backlink to below are considerably not associated to ours, we feel they may be in fact really worth a go via, so possess a look[…]

Title

[…]we like to honor many other internet web pages around the web, even when they aren’t linked to us, by linking to them. Below are some webpages really worth checking out[…]

Title

[…]very couple of internet sites that transpire to become in depth beneath, from our point of view are undoubtedly very well really worth checking out[…]

Title

[…]Wonderful story, reckoned we could combine several unrelated information, nevertheless actually worth taking a look, whoa did one discover about Mid East has got more problerms at the same time […]