Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:626 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38455 invoked from network); 3 Apr 2003 05:50:06 -0000 Received: from unknown (HELO walkabout.org) (12.106.145.56) by pb1.pair.com with SMTP; 3 Apr 2003 05:50:06 -0000 Received: from [68.21.47.166] (HELO cooglewin) by walkabout.org (CommuniGate Pro SMTP 4.0.3) with ESMTP id 18799208 for internals@lists.php.net; Thu, 03 Apr 2003 00:23:06 -0500 To: Date: Thu, 3 Apr 2003 00:51:57 -0500 Message-ID: <000a01c2f9a5$276b2ad0$1f01a8c0@cooglewin> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Subject: Patch GD (updated) From: john@coggeshall.org ("John Coggeshall") Okay... Here's the patch again. This is only one patch to correct the error handling of the GD extension when using T1Lib... If someone really wants me to post a second patch for the imagepscopyfont() function I will, but it's a really trivial... I just suggested we throw a warning instead of completely removing the function from the extension for BC reasons... Here's the error handling patch: Index: gd.c =================================================================== RCS file: /repository/php4/ext/gd/gd.c,v retrieving revision 1.261 diff -u -r1.261 gd.c --- gd.c 31 Mar 2003 08:49:19 -0000 1.261 +++ gd.c 3 Apr 2003 05:45:59 -0000 @@ -3188,21 +3188,7 @@ f_ind = T1_AddFont(Z_STRVAL_PP(file)); if (f_ind < 0) { - switch (f_ind) { - case -1: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find the font file"); - RETURN_FALSE; - break; - case -2: - case -3: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation fault in t1lib"); - RETURN_FALSE; - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred in t1lib"); - RETURN_FALSE; - break; - } + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(f_ind)); } if (T1_LoadFont(f_ind)) { @@ -3476,7 +3462,7 @@ if (!str_path) { if (T1_errno) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "libt1 returned error %d", T1_errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno)); } RETURN_FALSE; } @@ -3495,7 +3481,7 @@ str_img = T1_AAFillOutline(str_path, 0); if (T1_errno) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "libt1 returned error %d", T1_errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno)); RETURN_FALSE; } John -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-