From: Cristy Date: Mon, 30 Sep 2019 00:32:20 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/pull/1708 X-Git-Tag: 7.0.8-68~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46d4fb5c9d9e739723a75e9ee287912ee19b6356;p=imagemagick https://github.com/ImageMagick/ImageMagick/pull/1708 --- diff --git a/coders/webp.c b/coders/webp.c index cf2e5549b..70334e4d9 100644 --- a/coders/webp.c +++ b/coders/webp.c @@ -58,6 +58,7 @@ #include "MagickCore/option.h" #include "MagickCore/pixel-accessor.h" #include "MagickCore/profile.h" +#include "MagickCore/property.h" #include "MagickCore/quantum-private.h" #include "MagickCore/static.h" #include "MagickCore/string_.h" @@ -71,6 +72,7 @@ #include #if defined(MAGICKCORE_WEBPMUX_DELEGATE) #include +#include #endif #endif @@ -207,6 +209,193 @@ static MagickBooleanType IsWEBPImageLossless(const unsigned char *stream, return(MagickFalse); } +static int FillBasicWEBPInfo(Image *image, const uint8_t *stream, + size_t length, WebPDecoderConfig *configure){ + WebPBitstreamFeatures + *magick_restrict features = &configure->input; + + int + webp_status; + + webp_status=WebPGetFeatures(stream,length,features); + + if (webp_status != VP8_STATUS_OK) + return webp_status; + + image->columns=(size_t) features->width; + image->rows=(size_t) features->height; + image->depth=8; + image->alpha_trait=features->has_alpha != 0 ? BlendPixelTrait : + UndefinedPixelTrait; + + return webp_status; +} + +static int ReadSingleWEBPImage(Image *image, const uint8_t *stream, size_t length, + WebPDecoderConfig *configure, ExceptionInfo *exception){ + int + webp_status; + + register unsigned char + *p; + + ssize_t + y; + + WebPDecBuffer + *magick_restrict webp_image = &configure->output; + + MagickBooleanType + status; + + webp_status = FillBasicWEBPInfo(image,stream,length,configure); + if(webp_status != VP8_STATUS_OK) + return webp_status; + + if (IsWEBPImageLossless(stream,length) != MagickFalse) + image->quality=100; + + webp_status=WebPDecode(stream,length, configure); + if(webp_status != VP8_STATUS_OK) + return webp_status; + + p=(unsigned char *) webp_image->u.RGBA.rgba; + for (y=0; y < (ssize_t) image->rows; y++) + { + register Quantum + *q; + + register ssize_t + x; + + q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); + if (q == (Quantum *) NULL) + break; + for (x=0; x < (ssize_t) image->columns; x++) + { + SetPixelRed(image,ScaleCharToQuantum(*p++),q); + SetPixelGreen(image,ScaleCharToQuantum(*p++),q); + SetPixelBlue(image,ScaleCharToQuantum(*p++),q); + SetPixelAlpha(image,ScaleCharToQuantum(*p++),q); + q+=GetPixelChannels(image); + } + if (SyncAuthenticPixels(image,exception) == MagickFalse) + break; + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, + image->rows); + if (status == MagickFalse) + break; + } + WebPFreeDecBuffer(webp_image); +#if defined(MAGICKCORE_WEBPMUX_DELEGATE) + { + StringInfo + *profile; + + uint32_t + webp_flags = 0; + + WebPData + chunk, + content = { stream, length }; + + WebPMux + *mux; + + /* + Extract any profiles. + */ + mux=WebPMuxCreate(&content,0); + (void) memset(&chunk,0,sizeof(chunk)); + WebPMuxGetFeatures(mux,&webp_flags); + if (webp_flags & ICCP_FLAG) + { + WebPMuxGetChunk(mux,"ICCP",&chunk); + profile=BlobToStringInfo(chunk.bytes,chunk.size); + if (profile != (StringInfo *) NULL) + { + SetImageProfile(image,"ICC",profile,exception); + profile=DestroyStringInfo(profile); + } + } + if (webp_flags & EXIF_FLAG) + { + WebPMuxGetChunk(mux,"EXIF",&chunk); + profile=BlobToStringInfo(chunk.bytes,chunk.size); + if (profile != (StringInfo *) NULL) + { + SetImageProfile(image,"EXIF",profile,exception); + profile=DestroyStringInfo(profile); + } + } + if (webp_flags & XMP_FLAG) + { + WebPMuxGetChunk(mux,"XMP",&chunk); + profile=BlobToStringInfo(chunk.bytes,chunk.size); + if (profile != (StringInfo *) NULL) + { + SetImageProfile(image,"XMP",profile,exception); + profile=DestroyStringInfo(profile); + } + } + WebPMuxDelete(mux); + } +#endif + return webp_status; +} + +#if defined(MAGICKCORE_WEBPMUX_DELEGATE) +static int ReadAnimatedWEBPImage(const ImageInfo *image_info, Image *image, + uint8_t *stream, size_t length, WebPDecoderConfig *configure, + ExceptionInfo *exception) { + WebPData data = {.bytes=stream, .size=length}; + + WebPDemuxer* demux = WebPDemux(&data); + + WebPIterator iter; + + int + webp_status = 0; + + int image_count = 0; + + Image *original_image = image; + + if (WebPDemuxGetFrame(demux, 1, &iter)) { + do { + if (image_count != 0) + { + AcquireNextImage(image_info,image,exception); + if (GetNextImageInList(image) == (Image *) NULL) + { + break; + } + image=SyncNextImageInList(image); + CloneImageProperties(image, original_image); + image->page.x = iter.x_offset; + image->page.y = iter.y_offset; + } + + webp_status = ReadSingleWEBPImage(image, iter.fragment.bytes, + iter.fragment.size, + configure, exception); + if(webp_status != VP8_STATUS_OK) + break; + + image->ticks_per_second = 100; + image->delay = iter.duration / 10; + if (image_info->verbose) + fprintf(stderr, "Reading WebP frame with delay %u\n", iter.duration); + image_count++; + + } while (WebPDemuxNextFrame(&iter)); + WebPDemuxReleaseIterator(&iter); + } + WebPDemuxDelete(demux); + return webp_status; +} +#endif + static Image *ReadWEBPImage(const ImageInfo *image_info, ExceptionInfo *exception) { @@ -228,15 +417,11 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, MagickBooleanType status; - register unsigned char - *p; - size_t length; ssize_t - count, - y; + count; unsigned char header[12], @@ -248,9 +433,6 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, WebPDecBuffer *magick_restrict webp_image = &configure.output; - WebPBitstreamFeatures - *magick_restrict features = &configure.input; - /* Open image file. */ @@ -290,31 +472,29 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, count=ReadBlob(image,length-12,stream+12); if (count != (ssize_t) (length-12)) ThrowWEBPException(CorruptImageError,"InsufficientImageDataInFile"); - webp_status=WebPGetFeatures(stream,length,features); - if (webp_status == VP8_STATUS_OK) - { - image->columns=(size_t) features->width; - image->rows=(size_t) features->height; - image->depth=8; - image->alpha_trait=features->has_alpha != 0 ? BlendPixelTrait : - UndefinedPixelTrait; - if (image_info->ping != MagickFalse) - { - stream=(unsigned char*) RelinquishMagickMemory(stream); - (void) CloseBlob(image); - return(GetFirstImageInList(image)); - } - status=SetImageExtent(image,image->columns,image->rows,exception); - if (status == MagickFalse) - { - stream=(unsigned char*) RelinquishMagickMemory(stream); - (void) CloseBlob(image); - return(DestroyImageList(image)); - } - if (IsWEBPImageLossless(stream,length) != MagickFalse) - image->quality=100; - webp_status=WebPDecode(stream,length,&configure); + + webp_status=FillBasicWEBPInfo(image,stream,length,&configure); + if (webp_status == VP8_STATUS_OK) { + if (image_info->ping != MagickFalse) + { + stream=(unsigned char*) RelinquishMagickMemory(stream); + (void) CloseBlob(image); + return(GetFirstImageInList(image)); + } + + if (configure.input.has_animation) { +#if defined(MAGICKCORE_WEBPMUX_DELEGATE) + webp_status=ReadAnimatedWEBPImage(image_info, image, stream, + length, &configure, exception); +#else + webp_status=VP8_STATUS_UNSUPPORTED_FEATURE +#endif + } else { + webp_status=ReadSingleWEBPImage(image, stream, + length, &configure, exception); } + } + if (webp_status != VP8_STATUS_OK) switch (webp_status) { @@ -356,88 +536,7 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, default: ThrowWEBPException(CorruptImageError,"CorruptImage"); } - p=(unsigned char *) webp_image->u.RGBA.rgba; - for (y=0; y < (ssize_t) image->rows; y++) - { - register Quantum - *q; - register ssize_t - x; - - q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (Quantum *) NULL) - break; - for (x=0; x < (ssize_t) image->columns; x++) - { - SetPixelRed(image,ScaleCharToQuantum(*p++),q); - SetPixelGreen(image,ScaleCharToQuantum(*p++),q); - SetPixelBlue(image,ScaleCharToQuantum(*p++),q); - SetPixelAlpha(image,ScaleCharToQuantum(*p++),q); - q+=GetPixelChannels(image); - } - if (SyncAuthenticPixels(image,exception) == MagickFalse) - break; - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, - image->rows); - if (status == MagickFalse) - break; - } - WebPFreeDecBuffer(webp_image); -#if defined(MAGICKCORE_WEBPMUX_DELEGATE) - { - StringInfo - *profile; - - uint32_t - webp_flags = 0; - - WebPData - chunk, - content = { stream, length }; - - WebPMux - *mux; - - /* - Extract any profiles. - */ - mux=WebPMuxCreate(&content,0); - (void) memset(&chunk,0,sizeof(chunk)); - WebPMuxGetFeatures(mux,&webp_flags); - if (webp_flags & ICCP_FLAG) - { - WebPMuxGetChunk(mux,"ICCP",&chunk); - profile=BlobToStringInfo(chunk.bytes,chunk.size); - if (profile != (StringInfo *) NULL) - { - SetImageProfile(image,"ICC",profile,exception); - profile=DestroyStringInfo(profile); - } - } - if (webp_flags & EXIF_FLAG) - { - WebPMuxGetChunk(mux,"EXIF",&chunk); - profile=BlobToStringInfo(chunk.bytes,chunk.size); - if (profile != (StringInfo *) NULL) - { - SetImageProfile(image,"EXIF",profile,exception); - profile=DestroyStringInfo(profile); - } - } - if (webp_flags & XMP_FLAG) - { - WebPMuxGetChunk(mux,"XMP",&chunk); - profile=BlobToStringInfo(chunk.bytes,chunk.size); - if (profile != (StringInfo *) NULL) - { - SetImageProfile(image,"XMP",profile,exception); - profile=DestroyStringInfo(profile); - } - } - WebPMuxDelete(mux); - } -#endif stream=(unsigned char*) RelinquishMagickMemory(stream); (void) CloseBlob(image); return(image); @@ -487,7 +586,7 @@ ModuleExport size_t RegisterWEBPImage(void) #endif entry->mime_type=ConstantString("image/webp"); entry->flags|=CoderDecoderSeekableStreamFlag; - entry->flags^=CoderAdjoinFlag; + entry->flags|=CoderAdjoinFlag; entry->magick=(IsImageFormatHandler *) IsWEBP; if (*version != '\0') entry->version=ConstantString(version); @@ -575,8 +674,151 @@ static int WebPEncodeWriter(const unsigned char *stream,size_t length, } #endif +typedef struct PictureMemory { + MemoryInfo *pixel_info; + struct PictureMemory *next; +} PictureMemory; + +static void FreePictureMemoryList (PictureMemory* head) { + PictureMemory* next; + while(head != NULL) { + next = head->next; + if(head->pixel_info != NULL) + RelinquishVirtualMemory(head->pixel_info); + free(head); + head = next; + } +} + +static MagickBooleanType WriteSingleWEBPImage(const ImageInfo *image_info, Image *image, + WebPPicture *picture, PictureMemory *picture_memory, ExceptionInfo *exception) +{ + MagickBooleanType + status = MagickFalse; + + register uint32_t + *magick_restrict q; + + ssize_t + y; + +#if WEBP_ENCODER_ABI_VERSION >= 0x0100 + picture->progress_hook=WebPEncodeProgress; + picture->user_data=(void *) image; +#endif + picture->width=(int) image->columns; + picture->height=(int) image->rows; + picture->argb_stride=(int) image->columns; + picture->use_argb=1; + + /* + Allocate memory for pixels. + */ + (void) TransformImageColorspace(image,sRGBColorspace,exception); + picture_memory->pixel_info=AcquireVirtualMemory(image->columns,image->rows* + sizeof(*(picture->argb))); + + if (picture_memory->pixel_info == (MemoryInfo *) NULL) + ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); + picture->argb=(uint32_t *) GetVirtualMemoryBlob(picture_memory->pixel_info); + /* + Convert image to WebP raster pixels. + */ + q=picture->argb; + for (y=0; y < (ssize_t) image->rows; y++) + { + register const Quantum + *magick_restrict p; + + register ssize_t + x; + + p=GetVirtualPixels(image,0,y,image->columns,1,exception); + if (p == (const Quantum *) NULL) + break; + for (x=0; x < (ssize_t) image->columns; x++) + { + *q++=(uint32_t) (image->alpha_trait != UndefinedPixelTrait ? (uint32_t) + ScaleQuantumToChar(GetPixelAlpha(image,p)) << 24 : 0xff000000) | + ((uint32_t) ScaleQuantumToChar(GetPixelRed(image,p)) << 16) | + ((uint32_t) ScaleQuantumToChar(GetPixelGreen(image,p)) << 8) | + ((uint32_t) ScaleQuantumToChar(GetPixelBlue(image,p))); + p+=GetPixelChannels(image); + } + status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, + image->rows); + if (status == MagickFalse) + break; + } + return status; +} + +#if defined(MAGICKCORE_WEBPMUX_DELEGATE) +static MagickBooleanType WriteAnimatedWEBPImage(const ImageInfo *image_info, + Image *image, WebPConfig *configure, + WebPMemoryWriter *writer_info, ExceptionInfo *exception) +{ + WebPAnimEncoderOptions + enc_options; + WebPPicture + picture; + WebPAnimEncoder + *enc; + Image + *first_image; + PictureMemory + *head, *current; + + size_t frame_timestamp = 0, + effective_delta = 0; + + WebPAnimEncoderOptionsInit(&enc_options); + if (image_info->verbose) + enc_options.verbose = 1; + + image = CoalesceImages(image, exception); + first_image = image; + enc = WebPAnimEncoderNew(image->page.width, image->page.height, &enc_options); + + head = calloc(sizeof(*head), 1); + current = head; + + while(image != NULL) { + if (WebPPictureInit(&picture) == 0) + ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile"); + + WriteSingleWEBPImage(image_info, image, &picture, current, exception); + + effective_delta = image->delay*1000/image->ticks_per_second; + if (effective_delta < 10) + effective_delta = 100; // Consistent with gif2webp + frame_timestamp+=effective_delta; + + if (image_info->verbose) + fprintf(stderr, "Writing WebP frame with delay %zu\n", effective_delta); + + WebPAnimEncoderAdd(enc, &picture, frame_timestamp, configure); + + image = GetNextImageInList(image); + current->next = calloc(sizeof(*head), 1); + current = current->next; + } + WebPData + webp_data = { writer_info->mem, writer_info->size }; + + WebPAnimEncoderAssemble(enc, &webp_data); + WebPMemoryWriterClear(writer_info); + writer_info->size=webp_data.size; + writer_info->mem=(unsigned char *) webp_data.bytes; + WebPAnimEncoderDelete(enc); + DestroyImageList(first_image); + FreePictureMemoryList(head); + return MagickTrue; +} +#endif + static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, - Image *image,ExceptionInfo *exception) + Image *image,ExceptionInfo * exception) { const char *value; @@ -587,15 +829,6 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, MagickBooleanType status; - MemoryInfo - *pixel_info; - - register uint32_t - *magick_restrict q; - - ssize_t - y; - WebPAuxStats statistics; @@ -610,6 +843,9 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, WebPPicture picture; + PictureMemory + memory = {0}; + /* Open output image file. */ @@ -624,7 +860,9 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception); if (status == MagickFalse) return(status); - if ((WebPPictureInit(&picture) == 0) || (WebPConfigInit(&configure) == 0)) + if (WebPConfigInit(&configure) == 0) + ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile"); + if (WebPPictureInit(&picture) == 0) ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile"); #if !defined(MAGICKCORE_WEBPMUX_DELEGATE) picture.writer=WebPEncodeWriter; @@ -633,16 +871,8 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, WebPMemoryWriterInit(&writer_info); picture.writer=WebPMemoryWrite; picture.custom_ptr=(&writer_info); -#endif -#if WEBP_ENCODER_ABI_VERSION >= 0x0100 - picture.progress_hook=WebPEncodeProgress; - picture.user_data=(void *) image; #endif picture.stats=(&statistics); - picture.width=(int) image->columns; - picture.height=(int) image->rows; - picture.argb_stride=(int) image->columns; - picture.use_argb=1; if (image->quality != UndefinedCompressionQuality) configure.quality=(float) image->quality; if (image->quality >= 100) @@ -737,44 +967,19 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, #endif if (WebPValidateConfig(&configure) == 0) ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile"); - /* - Allocate memory for pixels. - */ - (void) TransformImageColorspace(image,sRGBColorspace,exception); - pixel_info=AcquireVirtualMemory(image->columns,image->rows* - sizeof(*picture.argb)); - if (pixel_info == (MemoryInfo *) NULL) - ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); - picture.argb=(uint32_t *) GetVirtualMemoryBlob(pixel_info); - /* - Convert image to WebP raster pixels. - */ - q=picture.argb; - for (y=0; y < (ssize_t) image->rows; y++) - { - register const Quantum - *magick_restrict p; - register ssize_t - x; + WriteSingleWEBPImage(image_info, image, &picture, + &memory, exception); - p=GetVirtualPixels(image,0,y,image->columns,1,exception); - if (p == (const Quantum *) NULL) - break; - for (x=0; x < (ssize_t) image->columns; x++) - { - *q++=(uint32_t) (image->alpha_trait != UndefinedPixelTrait ? (uint32_t) - ScaleQuantumToChar(GetPixelAlpha(image,p)) << 24 : 0xff000000) | - ((uint32_t) ScaleQuantumToChar(GetPixelRed(image,p)) << 16) | - ((uint32_t) ScaleQuantumToChar(GetPixelGreen(image,p)) << 8) | - ((uint32_t) ScaleQuantumToChar(GetPixelBlue(image,p))); - p+=GetPixelChannels(image); - } - status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, - image->rows); - if (status == MagickFalse) - break; +#if defined(MAGICKCORE_WEBPMUX_DELEGATE) + if ((GetPreviousImageInList(image) == (Image *) NULL) && + (GetNextImageInList(image) != (Image *) NULL) && + (image->iterations != 1)) { + WriteAnimatedWEBPImage(image_info, image, &configure, + &writer_info, exception); } +#endif + webp_status=WebPEncode(&configure,&picture); if (webp_status == 0) { @@ -912,8 +1117,8 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, #if defined(MAGICKCORE_WEBPMUX_DELEGATE) WebPMemoryWriterClear(&writer_info); #endif - pixel_info=RelinquishVirtualMemory(pixel_info); (void) CloseBlob(image); + RelinquishVirtualMemory(memory.pixel_info); return(webp_status == 0 ? MagickFalse : MagickTrue); } #endif diff --git a/configure b/configure index 3bffb7d3b..6726eed1e 100755 --- a/configure +++ b/configure @@ -4576,7 +4576,7 @@ MAGICK_PATCHLEVEL_VERSION=68 MAGICK_VERSION=7.0.8-68 -MAGICK_GIT_REVISION=16148:a5041aca3:20190929 +MAGICK_GIT_REVISION=16146:da4f7e6d2:20190929 # Substitute library versioning @@ -33577,19 +33577,19 @@ $as_echo "yes" >&6; } fi pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libwebpmux >= 0.4.4" >&5 -$as_echo_n "checking for libwebpmux >= 0.4.4... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libwebpmux >= 0.4.4 libwebpdemux >= 0.4.4" >&5 +$as_echo_n "checking for libwebpmux >= 0.4.4 libwebpdemux >= 0.4.4... " >&6; } if test -n "$WEBPMUX_CFLAGS"; then pkg_cv_WEBPMUX_CFLAGS="$WEBPMUX_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libwebpmux >= 0.4.4\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libwebpmux >= 0.4.4") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libwebpmux >= 0.4.4 libwebpdemux >= 0.4.4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libwebpmux >= 0.4.4 libwebpdemux >= 0.4.4") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_WEBPMUX_CFLAGS=`$PKG_CONFIG --cflags "libwebpmux >= 0.4.4" 2>/dev/null` + pkg_cv_WEBPMUX_CFLAGS=`$PKG_CONFIG --cflags "libwebpmux >= 0.4.4 libwebpdemux >= 0.4.4" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -33601,12 +33601,12 @@ if test -n "$WEBPMUX_LIBS"; then pkg_cv_WEBPMUX_LIBS="$WEBPMUX_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libwebpmux >= 0.4.4\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libwebpmux >= 0.4.4") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libwebpmux >= 0.4.4 libwebpdemux >= 0.4.4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libwebpmux >= 0.4.4 libwebpdemux >= 0.4.4") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_WEBPMUX_LIBS=`$PKG_CONFIG --libs "libwebpmux >= 0.4.4" 2>/dev/null` + pkg_cv_WEBPMUX_LIBS=`$PKG_CONFIG --libs "libwebpmux >= 0.4.4 libwebpdemux >= 0.4.4" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -33627,9 +33627,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - WEBPMUX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libwebpmux >= 0.4.4" 2>&1` + WEBPMUX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libwebpmux >= 0.4.4 libwebpdemux >= 0.4.4" 2>&1` else - WEBPMUX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libwebpmux >= 0.4.4" 2>&1` + WEBPMUX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libwebpmux >= 0.4.4 libwebpdemux >= 0.4.4" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$WEBPMUX_PKG_ERRORS" >&5 diff --git a/configure.ac b/configure.ac index 258f2567e..e46e9c73d 100644 --- a/configure.ac +++ b/configure.ac @@ -2877,7 +2877,7 @@ WEBPMUX_PKG="" if test "x$with_webp" = "xyes"; then AC_MSG_RESULT([-------------------------------------------------------------]) PKG_CHECK_MODULES(WEBP,[libwebp], have_webp=yes, have_webp=no) - PKG_CHECK_MODULES(WEBPMUX,[libwebpmux >= 0.4.4], have_webpmux=yes, have_webpmux=no) + PKG_CHECK_MODULES(WEBPMUX,[libwebpmux >= 0.4.4 libwebpdemux >= 0.4.4], have_webpmux=yes, have_webpmux=no) AC_MSG_RESULT([]) fi