Images cannot be generated, because your PHP installation's GD library has no JPEG support.
rockyrackoon - January 2, 2008 - 09:13
| Project: | CAPTCHA |
| Version: | 5.x-3.1 |
| Component: | Image Captcha (image_captcha) |
| Category: | support request |
| Priority: | normal |
| Assigned: | rockyrackoon |
| Status: | closed |
| Issue tags: | Newbie |
Jump to:
Description
Hi
Ive been trying to enable the CAPTCHA images.
I get this message:
"Images cannot be generated, because your PHP installation's GD library has no JPEG support."
My PHP configure:
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql' '--enable-soap' '--with-openssl' '--with-gd' '--with-jpeg-dir=/usr' '--with-ttf' '--with-freetype' '--enable-gd-native-ttf'
My PHP version is 5.2.3
Working on Linux.
Drupal 5.5
downloaded gdlib, jpeglib is available at /usr.
Other ideas?
I've got this thread going on too: http://drupal.org/node/205298#comment-675529 but still no luck.
Thank in advance,
Rocky

#1
could you execute the following php on your server, for example by creating a new page with the "PHP code" input format:
<?phpif (function_exists('imagegd2')) {
var_export(gd_info());
}
$fs = array('imagejpeg', 'imagecreatetruecolor', 'imagedestroy',
'imagecolorallocate', 'imagefilledrectangle', 'imagecolorat', 'imagesetpixel',
'imageline', 'imagefontwidth', 'imagettfbbox', 'imagestring', 'imagettftext',
);
foreach($fs as $f) {
print "$f: ". var_export(function_exists($f), TRUE) .'<br />';
}
?>
and post the result?
(from http://drupal.org/node/183608#comment-614940)
#2
sure - here's the result:
what now?
#3
You have no jpeg support. I'm not very familiar with compiling PHP, so I can't help you with this.
But you seem to have PNG support.
If you are not afraid of hacking, you could change image_captcha to work with PNG instead of JPEG.
at first sight, the only changes in "image_captcha.module" you should do are:
replace "imagejpeg" with "imagepng" (globally in the source code)
and replace 'drupal_set_header("Content-type: image/jpeg");' with 'drupal_set_header("Content-type: image/png");' (around line 400)
try this and report your findings (and post a patch)
I have no time right now to do it myself
#4
Good job!
I've hacked it to use png and it works now.
Thanks!
what do you mean by "post a patch"?
and where can i find fonts to use with the captcha, cince it keeps warning me about the default font?
thank you anyway
rocky
#5
If you're not familiar with this, it will probably be easier to do it myself than explaining this, so nevermind ;)
If you're still interested: http://drupal.org/patch
Also note that you now have a custom version of the image CAPTCHA module, so any future upgrade of the module will overwrite your changes.
There are thousands of font sites out there.
I use http://www.dafont.com often
#6
if you follow the hints on your forum thread you might even get jpeg working. It's difficult to keep two seperate pleas for help under control
#7
Automatically closed -- issue fixed for two weeks with no activity.