diff --git a/coders/webp.c b/coders/webp.c
index f9afc25..95ac4c9 100644
--- a/coders/webp.c
+++ b/coders/webp.c
@@ -323,7 +323,7 @@
}
if (IsWEBPImageLossless(stream,length) != MagickFalse)
image->quality=100;
- p=webp_image->u.RGBA.rgba;
+ p=(unsigned char *) webp_image->u.RGBA.rgba;
for (y=0; y < (ssize_t) image->rows; y++)
{
register Quantum
@@ -459,7 +459,22 @@
%
*/
-static int WebPWriter(const unsigned char *stream,size_t length,
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+static int WebPEncodeProgress(int percent,const WebPPicture* picture)
+{
+ Image
+ *image;
+
+ MagickBooleanType
+ status;
+
+ image=(Image *) picture->custom_ptr;
+ status=SetImageProgress(image,SaveImageTag,percent-1,100);
+ return(status == MagickFalse ? 0 : 1);
+}
+#endif
+
+static int WebPEncodeWriter(const unsigned char *stream,size_t length,
const WebPPicture *const picture)
{
Image
@@ -515,8 +530,11 @@
return(status);
if ((WebPPictureInit(&picture) == 0) || (WebPConfigInit(&configure) == 0))
ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile");
- picture.writer=WebPWriter;
+ picture.writer=WebPEncodeWriter;
picture.custom_ptr=(void *) image;
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+ picture.progress_hook=WebPEncodeProgress;
+#endif
picture.stats=(&statistics);
picture.width=(int) image->columns;
picture.height=(int) image->rows;
@@ -529,8 +547,8 @@
configure.lossless=1;
value=GetImageOption(image_info,"webp:lossless");
if (value != (char *) NULL)
- configure.lossless=ParseCommandOption(MagickBooleanOptions,MagickFalse,
- value);
+ configure.lossless=(int) ParseCommandOption(MagickBooleanOptions,
+ MagickFalse,value);
value=GetImageOption(image_info,"webp:method");
if (value != (char *) NULL)
configure.method=StringToInteger(value);
@@ -567,8 +585,8 @@
configure.filter_type=StringToInteger(value);
value=GetImageOption(image_info,"webp:auto-filter");
if (value != (char *) NULL)
- configure.autofilter=ParseCommandOption(MagickBooleanOptions,MagickFalse,
- value);
+ configure.autofilter=(int) ParseCommandOption(MagickBooleanOptions,
+ MagickFalse,value);
value=GetImageOption(image_info,"webp:alpha-compression");
if (value != (char *) NULL)
configure.alpha_compression=StringToInteger(value);