only use webp presets in lossy mode
it seems lossless and near-lossless modes have a separate preset system see https://github.com/jcupitt/libvips/issues/578
This commit is contained in:
parent
c5e675f7db
commit
dafa26435e
@ -237,7 +237,18 @@ write_webp( WebPPicture *pic, VipsImage *in,
|
||||
WebPConfig config;
|
||||
webp_import import;
|
||||
|
||||
if ( !WebPConfigPreset( &config, get_preset( preset ), Q ) ) {
|
||||
if( !WebPConfigInit( &config ) ) {
|
||||
vips_error( "vips2webp",
|
||||
"%s", _( "config version error" ) );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/* These presets are only for lossy compression. There seems to be
|
||||
* separate API for lossless or near-lossless, see
|
||||
* WebPConfigLosslessPreset().
|
||||
*/
|
||||
if( !(lossless || near_lossless) &&
|
||||
!WebPConfigPreset( &config, get_preset( preset ), Q ) ) {
|
||||
vips_error( "vips2webp", "%s", _( "config version error" ) );
|
||||
return( -1 );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user