private function getQualityFromExtension($ext, $transform = null): string
    {
        /** @var ConfigModel $settings */
        $config = ImagerService::getConfig();

        switch ($ext) {
            case 'png':
                $pngCompression = $config->getSetting('pngCompressionLevel', $transform);

                return max(100 - ($pngCompression * 10), 1);

            case 'webp':
                return $config->getSetting('webpQuality', $transform);
        }

        return $config->getSetting('jpegQuality', $transform);
    }
private function getQualityFromExtension($ext, $transform = null): string
    {
        /** @var ConfigModel $settings */
        $config = ImagerService::getConfig();

        switch ($ext) {
            case 'png':
                $pngCompression = $config->getSetting('pngCompressionLevel', $transform);

                return max(100 - ($pngCompression * 10), 1);

            case 'webp':
                return $config->getSetting('webpQuality', $transform);
        }

        return $config->getSetting('jpegQuality', $transform);
    }
private function getQualityFromExtension ( $ ext , $ transform = null ) : string { /** @var ConfigModel $settings */ $ config = ImagerService :: getConfig ( ) ; switch ( $ ext ) { case 'png' : $ pngCompression = $ config -> getSetting ( 'pngCompressionLevel' , $ transform ) ; return max ( 100 - ( $ pngCompression * 10 ) , 1 ) ; case 'webp' : return $ config -> getSetting ( 'webpQuality' , $ transform ) ; } return $ config -> getSetting ( 'jpegQuality' , $ transform ) ; }
Gets the quality setting based on the extension.

@param string $ext
@param array|null   $transform

@return string
Gets the quality setting based on the extension .