]> granicus.if.org Git - php/commitdiff
- Cleanup imagetransparent in the GD library
authorAndi Gutmans <andi@php.net>
Tue, 22 Aug 2000 04:11:57 +0000 (04:11 +0000)
committerAndi Gutmans <andi@php.net>
Tue, 22 Aug 2000 04:11:57 +0000 (04:11 +0000)
ext/gd/gd.c

index 582e6a28c023a60c773e0b06e585c6d97df9471c..35854073900122ed496ede49c78aff052e50f8a5 100644 (file)
@@ -1391,7 +1391,7 @@ PHP_FUNCTION(imagecolorstotal)
    Define a color as transparent */
 PHP_FUNCTION(imagecolortransparent)
 {
-       zval **IM, **COL = NULL;
+       zval **IM, **COL;
        gdImagePtr im;
        int col;
        GDLS_FETCH();
@@ -1414,9 +1414,8 @@ PHP_FUNCTION(imagecolortransparent)
 
        ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", GDG(le_gd));
 
-       if (COL != NULL && (*COL) != NULL) {
-               col = (*COL)->value.lval;
-               gdImageColorTransparent(im,col);
+       if (ZEND_NUM_ARGS() > 1) {
+               gdImageColorTransparent(im, Z_LVAL_PP(COL));
        }
        col = gdImageGetTransparent(im);
        RETURN_LONG(col);