public static function isPngFile($filename)
    {
        try {
            $image = new ImageFile($filename);
            if (strtolower($image->getMime()) !== @image_type_to_mime_type(IMAGETYPE_PNG)) {
                return false;
            }

            return true;
        } catch (\RuntimeException $ex) {
            return false;
        }
    }
public static function isPngFile($filename)
    {
        try {
            $image = new ImageFile($filename);
            if (strtolower($image->getMime()) !== @image_type_to_mime_type(IMAGETYPE_PNG)) {
                return false;
            }

            return true;
        } catch (\RuntimeException $ex) {
            return false;
        }
    }
public static function isPngFile ( $ filename ) { try { $ image = new ImageFile ( $ filename ) ; if ( strtolower ( $ image -> getMime ( ) ) !== @ image_type_to_mime_type ( IMAGETYPE_PNG ) ) { return false ; } return true ; } catch ( \ RuntimeException $ ex ) { return false ; } }
Check if the given file is png file

@param  string  $filename
@return boolean true if png file,false otherwise
Check if the given file is png file