SourceForge logo
SourceForge logo
Menu

phpwiki-checkins

From: Reini U. <ru...@us...> - 2005年10月31日 16:44:25
Update of /cvsroot/phpwiki/phpwiki/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29252
Modified Files:
	Captcha.php 
Log Message:
fallback to PNG or GIF if JPEG support does not exist
Index: Captcha.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/Captcha.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -2 -b -p -d -r1.4 -r1.5
--- Captcha.php	30 Oct 2005 14:20:42 -0000	1.4
+++ Captcha.php	31 Oct 2005 16:44:13 -0000	1.5
@@ -160,7 +160,16 @@ class Captcha {
 imageline($jpg, $width-1,0,$width-1,$height-1,$tx);
 
- //TODO: JPEG or PNG?
+	if (function_exists("ImageJpeg")) {
 header("Content-type: image/jpeg");
 ImageJpeg($jpg);
+	} elseif (function_exists("ImagePNG")) {
+	 header("Content-type: image/png");
+	 ImagePNG($jpg);
+	} elseif (function_exists("ImageGIF")) {
+	 header("Content-type: image/gif");
+	 ImageGIF($jpg);
+	} else {
+	 trigger_error("missing GD bitmap support", E_USER_WARNING);
+	}
 }
 
@@ -168,4 +177,7 @@ class Captcha {
 
 // $Log$
+// Revision 1.5 2005年10月31日 16:44:13 rurban
+// fallback to PNG or GIF if JPEG support does not exist
+//
 // Revision 1.4 2005年10月30日 14:20:42 rurban
 // move Captcha specific vars and methods into a Captcha object
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /