From 35d610f038abe96fda97a9eeba3ebd33dc6f87ca Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 24 Aug 2019 16:50:22 -0400 Subject: [PATCH] https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=36581 --- ChangeLog | 6 ++++++ coders/url.c | 45 ++++++++++++++++++++++++++++++++++++++--- config/delegates.xml.in | 2 +- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5ddc626c..476282113 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-08-24 7.0.8-63 Cristy + * Release ImageMagick version 7.0.8-63, GIT revision 16... + +2019-08-24 7.0.8-62 Cristy + * Properly identify the image format of an HTTPS image. + 2019-08-23 7.0.8-62 Cristy * Release ImageMagick version 7.0.8-62, GIT revision 16061:7525595:20190823. diff --git a/coders/url.c b/coders/url.c index 22414c230..e491dd5c3 100644 --- a/coders/url.c +++ b/coders/url.c @@ -149,6 +149,48 @@ static Image *ReadURLImage(const ImageInfo *image_info,ExceptionInfo *exception) read_info=CloneImageInfo(image_info); SetImageInfoBlob(read_info,(void *) NULL,0); +#if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__) + if (LocaleCompare(read_info->magick,"https") == 0) + { + Image + *image, + *images, + *next; + + MagickBooleanType + status; + + /* + Leverage delegate to read HTTPS link. + */ + images=(Image *) NULL; + image=AcquireImage(image_info,exception); + status=InvokeDelegate(read_info,image,"https:decode",(char *) NULL, + exception); + if (status != MagickFalse) + { + (void) FormatLocaleString(read_info->filename,MagickPathExtent, + "%s.dat",read_info->unique); + *read_info->magick='\0'; + images=ReadImage(read_info,exception); + (void) RelinquishUniqueFileResource(read_info->filename); + (void) CopyMagickString(read_info->filename,image->filename, + MagickPathExtent); + (void) SetImageInfo(read_info,1,exception); + if (images != (Image *) NULL) + for (next=images; next != (Image *) NULL; next=next->next) + { + (void) CopyMagickString(next->filename,image->filename, + MagickPathExtent); + (void) CopyMagickString(next->magick,read_info->magick, + MagickPathExtent); + } + } + read_info=DestroyImageInfo(read_info); + image=DestroyImage(image); + return(images); + } +#endif if (LocaleCompare(read_info->magick,"file") == 0) { (void) CopyMagickString(read_info->filename,image_info->filename+2, @@ -287,10 +329,7 @@ ModuleExport size_t RegisterURLImage(void) entry->format_type=ImplicitFormatType; (void) RegisterMagickInfo(entry); entry=AcquireMagickInfo("URL","HTTPS","Uniform Resource Locator (https://)"); -#if defined(MAGICKCORE_WINDOWS_SUPPORT) && \ - !defined(__MINGW32__) entry->decoder=(DecodeImageHandler *) ReadURLImage; -#endif entry->format_type=ImplicitFormatType; (void) RegisterMagickInfo(entry); entry=AcquireMagickInfo("URL","FTP","Uniform Resource Locator (ftp://)"); diff --git a/config/delegates.xml.in b/config/delegates.xml.in index 688adf78e..c12eeca87 100644 --- a/config/delegates.xml.in +++ b/config/delegates.xml.in @@ -64,7 +64,7 @@ - + -- 2.40.0