]> granicus.if.org Git - php/commitdiff
Use the macro here and add an E_NOTICE
authorRasmus Lerdorf <rasmus@php.net>
Fri, 16 Nov 2001 11:59:04 +0000 (11:59 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Fri, 16 Nov 2001 11:59:04 +0000 (11:59 +0000)
ext/gd/gd.c

index ff7ebccd29eba69ce0930087d49c907c767d36c5..4c75b2a08ce93b2bddb34e2105f7e83d96134f34 100644 (file)
@@ -1592,8 +1592,9 @@ PHP_FUNCTION(imagecolorat)
 #if HAVE_LIBGD20
        if(gdImageTrueColor(im)) {
                if (im->tpixels && gdImageBoundsSafe(im, Z_LVAL_PP(x), Z_LVAL_PP(y))) {
-                       RETURN_LONG(im->tpixels[Z_LVAL_PP(x)][Z_LVAL_PP(y)]);
+                       RETURN_LONG(gdImageTrueColorPixel(im, Z_LVAL_PP(x), Z_LVAL_PP(y)));
                } else {
+                       php_error(E_NOTICE, "%ld,%ld is out of bounds",Z_LVAL_PP(x), Z_LVAL_PP(y));
                        RETURN_FALSE;
                }
        } else {
@@ -1605,6 +1606,7 @@ PHP_FUNCTION(imagecolorat)
                        RETURN_LONG(im->pixels[Z_LVAL_PP(x)][Z_LVAL_PP(y)]);
 #endif
                } else {
+                       php_error(E_NOTICE, "%ld,%ld is out of bounds",Z_LVAL_PP(x), Z_LVAL_PP(y));
                        RETURN_FALSE;
                }
 #if HAVE_LIBGD20