private function createParamsForVipsWebPSave()
    {
        // webpsave options are described here:
        // https://jcupitt.github.io/libvips/API/current/VipsForeignSave.html#vips-webpsave

        $options = [
            "Q" => $this->getCalculatedQuality(),
            'lossless' => $this->options['lossless'],
            'strip' => $this->options['metadata'] == 'none',
        ];

        // Only set the following options if they differ from the default of vipslib
        // This ensures we do not get warning if that property isn't supported
        if ($this->options['smart-subsample'] !== false) {
            $options['smart_subsample'] = $this->options['smart-subsample'];
        }
        if ($this->options['alpha-quality'] !== 100) {
            $options['alpha_q'] = $this->options['alpha-quality'];
        }
        if ($this->options['preset'] !== 0) {
            $options['preset'] = $this->options['preset'];
        }
        if ($this->options['near-lossless'] !== 100) {
            if ($options['lossless'] === true) {
                // We only let near_lossless have effect when lossless is set.
                // otherwise lossless auto would not work as expected
                $options['near_lossless'] = true;

                // In Vips, the near-lossless value is controlled by Q.
                // this differs from how it is done in cwebp, where it is an integer.
                // We have chosen same option syntax as cwebp
                $options['Q'] = $this->options['near-lossless'];
            }
        }
        return $options;
    }
private function createParamsForVipsWebPSave()
    {
        // webpsave options are described here:
        // https://jcupitt.github.io/libvips/API/current/VipsForeignSave.html#vips-webpsave

        $options = [
            "Q" => $this->getCalculatedQuality(),
            'lossless' => $this->options['lossless'],
            'strip' => $this->options['metadata'] == 'none',
        ];

        // Only set the following options if they differ from the default of vipslib
        // This ensures we do not get warning if that property isn't supported
        if ($this->options['smart-subsample'] !== false) {
            $options['smart_subsample'] = $this->options['smart-subsample'];
        }
        if ($this->options['alpha-quality'] !== 100) {
            $options['alpha_q'] = $this->options['alpha-quality'];
        }
        if ($this->options['preset'] !== 0) {
            $options['preset'] = $this->options['preset'];
        }
        if ($this->options['near-lossless'] !== 100) {
            if ($options['lossless'] === true) {
                // We only let near_lossless have effect when lossless is set.
                // otherwise lossless auto would not work as expected
                $options['near_lossless'] = true;

                // In Vips, the near-lossless value is controlled by Q.
                // this differs from how it is done in cwebp, where it is an integer.
                // We have chosen same option syntax as cwebp
                $options['Q'] = $this->options['near-lossless'];
            }
        }
        return $options;
    }
private function createParamsForVipsWebPSave ( ) { // webpsave options are described here: // https://jcupitt.github.io/libvips/API/current/VipsForeignSave.html#vips-webpsave $ options = [ "Q" => $ this -> getCalculatedQuality ( ) , 'lossless' => $ this -> options [ 'lossless' ] , 'strip' => $ this -> options [ 'metadata' ] == 'none' , ] ; // Only set the following options if they differ from the default of vipslib // This ensures we do not get warning if that property isn't supported if ( $ this -> options [ 'smart-subsample' ] !== false ) { $ options [ 'smart_subsample' ] = $ this -> options [ 'smart-subsample' ] ; } if ( $ this -> options [ 'alpha-quality' ] !== 100 ) { $ options [ 'alpha_q' ] = $ this -> options [ 'alpha-quality' ] ; } if ( $ this -> options [ 'preset' ] !== 0 ) { $ options [ 'preset' ] = $ this -> options [ 'preset' ] ; } if ( $ this -> options [ 'near-lossless' ] !== 100 ) { if ( $ options [ 'lossless' ] === true ) { // We only let near_lossless have effect when lossless is set. // otherwise lossless auto would not work as expected $ options [ 'near_lossless' ] = true ; // In Vips, the near-lossless value is controlled by Q. // this differs from how it is done in cwebp, where it is an integer. // We have chosen same option syntax as cwebp $ options [ 'Q' ] = $ this -> options [ 'near-lossless' ] ; } } return $ options ; }
Create parameters for webpsave

@return  array  the parameters as an array
Create parameters for webpsave