Transparent/alpha background patch provided
-
Nowadays it is desired to have images with alpha (transparent background) and would be nice if Really Simple Captcha did the same for the PNG and GIF outputs.
I hacked your code to achieve this, which is really easy. Just replace these lines:
if ( $im = imagecreatetruecolor( $this->img_size[0], $this->img_size[1] ) ) { $bg = imagecolorallocate( $im, $this->bg[0], $this->bg[1], $this->bg[2] );
with these:
if ( $im = imagecreatetruecolor( $this->img_size[0], $this->img_size[1] ) ) { imagesavealpha($im, true); imagealphablending($im, false); $bg = imagecolorallocatealpha( $im, $this->bg[0], $this->bg[1], $this->bg[2], 127 );
You can add the alpha value (4th param) to the class property. I didn’t bother.
Hope you’ll implement it in the next version … is there going to be a next version? The plugins page still says it’s compatible up to WP 3.3.2, which is already ancient now.
Cheers.
https://www.ads-software.com/extend/plugins/really-simple-captcha/
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Transparent/alpha background patch provided’ is closed to new replies.