protected function getDesiredImageQuality($ext, $format)
    {
        switch ($ext) {
            case 'jpeg':
            case 'jpg':
                $qualityConfig = $this->jpegQuality;
                break;

            case 'png':
                $qualityConfig = $this->pngQuality;
                break;

            default:
                $qualityConfig = null;
        }

        if (empty($qualityConfig)) {
            return null;
        }
        if (is_array($qualityConfig)) {
            if (isset($qualityConfig[$format])) {
                return $qualityConfig[$format];
            }
            if (isset($qualityConfig['default'])) {
                return $qualityConfig['default'];
            }
        }
        return $qualityConfig;
    }
protected function getDesiredImageQuality($ext, $format)
    {
        switch ($ext) {
            case 'jpeg':
            case 'jpg':
                $qualityConfig = $this->jpegQuality;
                break;

            case 'png':
                $qualityConfig = $this->pngQuality;
                break;

            default:
                $qualityConfig = null;
        }

        if (empty($qualityConfig)) {
            return null;
        }
        if (is_array($qualityConfig)) {
            if (isset($qualityConfig[$format])) {
                return $qualityConfig[$format];
            }
            if (isset($qualityConfig['default'])) {
                return $qualityConfig['default'];
            }
        }
        return $qualityConfig;
    }
protected function getDesiredImageQuality ( $ ext , $ format ) { switch ( $ ext ) { case 'jpeg' : case 'jpg' : $ qualityConfig = $ this -> jpegQuality ; break ; case 'png' : $ qualityConfig = $ this -> pngQuality ; break ; default : $ qualityConfig = null ; } if ( empty ( $ qualityConfig ) ) { return null ; } if ( is_array ( $ qualityConfig ) ) { if ( isset ( $ qualityConfig [ $ format ] ) ) { return $ qualityConfig [ $ format ] ; } if ( isset ( $ qualityConfig [ 'default' ] ) ) { return $ qualityConfig [ 'default' ] ; } } return $ qualityConfig ; }
Figure out image quality.

@param string $format

@returns mixed - string/integer quality or null if no config value is set
Figure out image quality .