Only generate truecolor PNGs if original image is already truecolor.
authorJens Frank <jeluf@users.mediawiki.org>
Thu, 20 May 2004 12:08:42 +0000 (12:08 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Thu, 20 May 2004 12:08:42 +0000 (12:08 +0000)
Will still generate truecolor for PHP 4.2 or earlier.

Fix for bug #918857

includes/Image.php

index 2482718..d0293a5 100644 (file)
@@ -35,15 +35,14 @@ class Image
 
                if ( $this->fileExists = file_exists( $this->imagePath ) ) // Sic!, "=" is intended
                {
-                       list($this->width, $this->height, $this->type, $this->attr) = getimagesize( $this->imagePath );
-                       $gid = getimagesize( $this->imagePath );
-                       $this->width = $gid["width"];
-                       $this->height = $gid["height"];
-                       $this->type = $gid["type"];
-                       $this->attr = $gid["attr"];
-                       if ( defined( $gid["bits"] ) ) 
+                       $gis = getimagesize( $this->imagePath );
+                       $this->width = $gis[0];
+                       $this->height = $gis[1];
+                       $this->type = $gis[2];
+                       $this->attr = $gis[3];
+                       if ( isset( $gis["bits"] ) ) 
                        {
-                               $this->bits = $gid["bits"];
+                               $this->bits = $gis["bits"];
                        } else {
                                $this->bits = 0;
                        }