From 747855573443944f1a85aa1f26a42ee114042d12 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Thu, 20 May 2004 12:08:42 +0000 Subject: [PATCH] Only generate truecolor PNGs if original image is already truecolor. Will still generate truecolor for PHP 4.2 or earlier. Fix for bug #918857 --- includes/Image.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/includes/Image.php b/includes/Image.php index 2482718c2b..d0293a5443 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -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; } -- 2.20.1