tif_webp.c: fix compiler warnings with MSVC

This commit is contained in:
Even Rouault 2020-10-14 14:39:50 +02:00
parent e2801db6fd
commit ac64d74bdf
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D

View File

@ -356,7 +356,7 @@ TWebPSetupEncode(TIFF* tif)
} }
if (!WebPConfigInitInternal(&sp->sEncoderConfig, WEBP_PRESET_DEFAULT, if (!WebPConfigInitInternal(&sp->sEncoderConfig, WEBP_PRESET_DEFAULT,
sp->quality_level, (float)sp->quality_level,
WEBP_ENCODER_ABI_VERSION)) { WEBP_ENCODER_ABI_VERSION)) {
TIFFErrorExt(tif->tif_clientdata, module, TIFFErrorExt(tif->tif_clientdata, module,
"Error creating WebP encoder configuration."); "Error creating WebP encoder configuration.");
@ -579,7 +579,7 @@ TWebPVSetField(TIFF* tif, uint32 tag, va_list ap)
#if WEBP_ENCODER_ABI_VERSION >= 0x0100 #if WEBP_ENCODER_ABI_VERSION >= 0x0100
sp->lossless = va_arg(ap, int); sp->lossless = va_arg(ap, int);
if (sp->lossless){ if (sp->lossless){
sp->quality_level = 100.0f; sp->quality_level = 100;
} }
return 1; return 1;
#else #else
@ -657,7 +657,7 @@ TIFFInitWebP(TIFF* tif, int scheme)
tif->tif_tagmethods.vsetfield = TWebPVSetField; /* hook for codec tags */ tif->tif_tagmethods.vsetfield = TWebPVSetField; /* hook for codec tags */
/* Default values for codec-specific fields */ /* Default values for codec-specific fields */
sp->quality_level = 75.0f; /* default comp. level */ sp->quality_level = 75; /* default comp. level */
sp->lossless = 0; /* default to false */ sp->lossless = 0; /* default to false */
sp->state = 0; sp->state = 0;
sp->nSamples = 0; sp->nSamples = 0;