helly           Mon Nov 18 11:53:05 2002 EDT

  Modified files:              (Branch: PHP_4_3)
    /php4/ext/standard  image.c 
  Log:
  MFH: Added colordepth for png\n
  
  
Index: php4/ext/standard/image.c
diff -u php4/ext/standard/image.c:1.72.2.3 php4/ext/standard/image.c:1.72.2.4
--- php4/ext/standard/image.c:1.72.2.3  Mon Nov 18 10:50:49 2002
+++ php4/ext/standard/image.c   Mon Nov 18 11:53:04 2002
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: image.c,v 1.72.2.3 2002/11/18 15:50:49 helly Exp $ */
+/* $Id: image.c,v 1.72.2.4 2002/11/18 16:53:04 helly Exp $ */
 
 #include "php.h"
 #include <stdio.h>
@@ -276,7 +276,15 @@
 static struct gfxinfo *php_handle_png (php_stream * stream TSRMLS_DC)
 {
        struct gfxinfo *result = NULL;
-       unsigned char dim[8];
+       unsigned char dim[9];
+/* Width:              4 bytes
+ * Height:             4 bytes
+ * Bit depth:          1 byte
+ * Color type:         1 byte
+ * Compression method: 1 byte
+ * Filter method:      1 byte
+ * Interlace method:   1 byte
+ */
 
        if (php_stream_seek(stream, 8, SEEK_CUR))
                return NULL;
@@ -287,6 +295,7 @@
        result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
        result->width  = (((unsigned int)dim[0]) << 24) + (((unsigned int)dim[1]) << 
16) + (((unsigned int)dim[2]) << 8) + ((unsigned int)dim[3]);
        result->height = (((unsigned int)dim[4]) << 24) + (((unsigned int)dim[5]) << 
16) + (((unsigned int)dim[6]) << 8) + ((unsigned int)dim[7]);
+       result->bits   = (unsigned int)dim[8];
        return result;
 }
 /* }}} */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to