CVS update: php3/functions

From: Date: Sat, 10 Oct 1998 22:35:50 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-1791@lists.php.net to get a copy of this message
Date: Saturday October 10, 1998 @ 18:35 Author: jim Update of /repository/php3/functions In directory asf:/u2/tmp/cvs-serv17219/functions Modified Files: gd.c Log Message: Make ImageInterlace and ImageColorTransparent parameters optional, and make them return the appropriate information. (So now you can simply query what the transparent color is or if the image is interlaced.) Index: php3/functions/gd.c diff -c php3/functions/gd.c:1.93 php3/functions/gd.c:1.94 *** php3/functions/gd.c:1.93 Mon Sep 14 11:59:23 1998 --- php3/functions/gd.c Sat Oct 10 18:35:50 1998 *************** *** 29,35 **** +----------------------------------------------------------------------+ */ ! /* $Id: gd.c,v 1.93 1998/09/14 15:59:23 martin Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ --- 29,35 ---- +----------------------------------------------------------------------+ */ ! /* $Id: gd.c,v 1.94 1998/10/10 22:35:50 jim Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ *************** *** 1064,1084 **** /* im, col */ void php3_imagecolortransparent(INTERNAL_FUNCTION_PARAMETERS) { ! pval *IM, *COL; gdImagePtr im; int col; int ind_type; GD_TLS_VARS; ! if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &IM, &COL) == FAILURE) ! { WRONG_PARAM_COUNT; } - convert_to_long(IM); - convert_to_long(COL); - - col = COL->value.lval; im = php3_list_find(IM->value.lval, &ind_type); if (!im || ind_type != GD_GLOBAL(le_gd)) { --- 1064,1091 ---- /* im, col */ void php3_imagecolortransparent(INTERNAL_FUNCTION_PARAMETERS) { ! pval *IM, *COL = NULL; gdImagePtr im; int col; int ind_type; GD_TLS_VARS; ! switch(ARG_COUNT(ht)) { ! case 1: ! if (getParameters(ht, 1, &IM) == FAILURE) { ! WRONG_PARAM_COUNT; ! } ! break; ! case 2: ! if (getParameters(ht, 2, &IM, &COL) == FAILURE) { ! WRONG_PARAM_COUNT; ! } ! convert_to_long(COL); ! break; ! default: WRONG_PARAM_COUNT; } convert_to_long(IM); im = php3_list_find(IM->value.lval, &ind_type); if (!im || ind_type != GD_GLOBAL(le_gd)) { *************** *** 1086,1112 **** RETURN_FALSE; } ! gdImageColorTransparent(im,col); ! RETURN_TRUE; } /* im, interlace */ void php3_imageinterlace(INTERNAL_FUNCTION_PARAMETERS) { ! pval *IM, *INT; gdImagePtr im; int interlace; int ind_type; GD_TLS_VARS; ! if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &IM, &INT) == FAILURE) ! { WRONG_PARAM_COUNT; } - convert_to_long(IM); - convert_to_long(INT); - - interlace = INT->value.lval; im = php3_list_find(IM->value.lval, &ind_type); if (!im || ind_type != GD_GLOBAL(le_gd)) { --- 1093,1130 ---- RETURN_FALSE; } ! if (COL != NULL) { ! col = COL->value.lval; ! gdImageColorTransparent(im,col); ! } ! col = gdImageGetTransparent(im); ! RETURN_LONG(col); } /* im, interlace */ void php3_imageinterlace(INTERNAL_FUNCTION_PARAMETERS) { ! pval *IM, *INT = NULL; gdImagePtr im; int interlace; int ind_type; GD_TLS_VARS; ! switch(ARG_COUNT(ht)) { ! case 1: ! if (getParameters(ht, 1, &IM) == FAILURE) { ! WRONG_PARAM_COUNT; ! } ! break; ! case 2: ! if (getParameters(ht, 2, &IM, &INT) == FAILURE) { ! WRONG_PARAM_COUNT; ! } ! convert_to_long(INT); ! break; ! default: WRONG_PARAM_COUNT; } convert_to_long(IM); im = php3_list_find(IM->value.lval, &ind_type); if (!im || ind_type != GD_GLOBAL(le_gd)) { *************** *** 1114,1121 **** RETURN_FALSE; } ! gdImageInterlace(im,interlace); ! RETURN_TRUE; } /* arg = 0 normal polygon --- 1132,1143 ---- RETURN_FALSE; } ! if (INT != NULL) { ! interlace = INT->value.lval; ! gdImageInterlace(im,interlace); ! } ! interlace = gdImageGetInterlaced(im); ! RETURN_LONG(interlace); } /* arg = 0 normal polygon -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1791) next »