public function show()
    {
        switch ($this->type) {
            case self::GIF:
                header("Content-Type: image/gif");
                imagegif($this->resource);
                break;
            case self::JPG:
                header("Content-Type: image/jpeg");
                imagejpeg($this->resource, null, $this->jpgQuality);
                break;
            case self::PNG:
                header("Content-Type: image/png");
                imagepng($this->resource);
                break;
            case self::BMP:
                header("Content-Type: image/wbmp");
                imagewbmp($this->resource);
                break;
            default:
                throw new ImageException("Unknown type of file " . ($this->pathToFile) . ".", ImageException::UnsupportedFormatException);
                break;
        }
    }