CImage.php
private function getPngTypeAsString($pngType = null, $filename = null)
    {
        if ($filename || !$pngType) {
            $pngType = $this->getPngType($filename);
        }

        $index = imagecolortransparent($this->image);
        $transparent = null;
        if ($index != -1) {
            $transparent = " (transparent)";
        }

        switch ($pngType) {

            case self::PNG_GREYSCALE:
                $text = "PNG is type 0, Greyscale$transparent";
                break;

            case self::PNG_RGB:
                $text = "PNG is type 2, RGB$transparent";
                break;

            case self::PNG_RGB_PALETTE:
                $text = "PNG is type 3, RGB with palette$transparent";
                break;

            case self::PNG_GREYSCALE_ALPHA:
                $text = "PNG is type 4, Greyscale with alpha channel";
                break;

            case self::PNG_RGB_ALPHA:
                $text = "PNG is type 6, RGB with alpha channel (PNG 32-bit)";
                break;

            default:
                $text = "PNG is UNKNOWN type, is it really a PNG image?";
        }

        return $text;
    }
private function getPngTypeAsString($pngType = null, $filename = null)
    {
        if ($filename || !$pngType) {
            $pngType = $this->getPngType($filename);
        }

        $index = imagecolortransparent($this->image);
        $transparent = null;
        if ($index != -1) {
            $transparent = " (transparent)";
        }

        switch ($pngType) {

            case self::PNG_GREYSCALE:
                $text = "PNG is type 0, Greyscale$transparent";
                break;

            case self::PNG_RGB:
                $text = "PNG is type 2, RGB$transparent";
                break;

            case self::PNG_RGB_PALETTE:
                $text = "PNG is type 3, RGB with palette$transparent";
                break;

            case self::PNG_GREYSCALE_ALPHA:
                $text = "PNG is type 4, Greyscale with alpha channel";
                break;

            case self::PNG_RGB_ALPHA:
                $text = "PNG is type 6, RGB with alpha channel (PNG 32-bit)";
                break;

            default:
                $text = "PNG is UNKNOWN type, is it really a PNG image?";
        }

        return $text;
    }
private function getPngTypeAsString ( $ pngType = null , $ filename = null ) { if ( $ filename || ! $ pngType ) { $ pngType = $ this -> getPngType ( $ filename ) ; } $ index = imagecolortransparent ( $ this -> image ) ; $ transparent = null ; if ( $ index != - 1 ) { $ transparent = " (transparent)" ; } switch ( $ pngType ) { case self :: PNG_GREYSCALE : $ text = "PNG is type 0, Greyscale$transparent" ; break ; case self :: PNG_RGB : $ text = "PNG is type 2, RGB$transparent" ; break ; case self :: PNG_RGB_PALETTE : $ text = "PNG is type 3, RGB with palette$transparent" ; break ; case self :: PNG_GREYSCALE_ALPHA : $ text = "PNG is type 4, Greyscale with alpha channel" ; break ; case self :: PNG_RGB_ALPHA : $ text = "PNG is type 6, RGB with alpha channel (PNG 32-bit)" ; break ; default : $ text = "PNG is UNKNOWN type, is it really a PNG image?" ; } return $ text ; }
Get the type of PNG image as a verbose string.

@param integer $type     to use, default is to check the type.
@param string  $filename to use instead of default.

@return int as the type of the png-image
Get the type of PNG image as a verbose string .