ImageMagick-7.0.8-40差分

ImageMagick-7.0.8-40差分

http://www.imagemagick.org/script/download.php
The latest release of ImageMagick is version 7.0.8-40

6 系同時リリースは ImageMagick-6.9.10-40

まとめ

気になる事
  • 設定ディレクトリ検索で LOCALAPPDATA, APPDATA, USERPROFILE を無条件に使っていたが、Windows 系のみに絞った
  • META データ読み込みで IPTC を誤って 8BIM プロファイルとして格納してたのを修正。
  • PS2 読み込みで PixelPerCentimeter の単位換算で、小数点を落とす不具合を修正。
  • WMF ファイル読み込みで Bounding Box が空の時はエラー。
  • MAT ファイル書き出しで異常系追加

ChangeLog にない差分

  • MagickCore/animate.c
    • const 修飾
94c94
<   *AnimateHelp[]=
---
>   *const AnimateHelp[] =
165c165
<   *PageSizes[]=
---
>   *const PageSizes[] =
<以下同様>
  • MagickCore/blob.c
    • ファイル情報が取得できない時用に、以前のファイル情報を初期値にする。
      • 単に値が入る前の未初期化の値を使ってるように読めるけど大丈夫?
MagickExport MagickSizeType GetBlobSize(const Image *image)
<略>
  switch (blob_info->type)
<略>
    case FileStream:
    {
      int
        file_descriptor;

+     extent=(MagickSizeType) blob_info->properties.st_size;
+    if (extent == 0)
+      extent=blob_info->size;
+    file_descriptor=fileno(blob_info->file_info.file);
+    if (file_descriptor == -1)
+      break;
      if (fstat(file_descriptor,&blob_info->properties) == 0)
        extent=(MagickSizeType) blob_info->properties.st_size;
      break;
    }
  • MagickCore/cache.c
    • コード整形
MagickCore/cache.c
440,441c440,441
<     nexus_info->region.width,nexus_info->region.height,nexus_info->virtual_nexus,
<     exception);
---
>     nexus_info->region.width,nexus_info->region.height,
>     nexus_info->virtual_nexus,exception);
473,475c473
<   if (n < (ssize_t) number_pixels)
<     return(MagickFalse);
<   return(MagickTrue);
---
>   return(n < (ssize_t) number_pixels ? MagickFalse : MagickTrue);
3409,3410c3407,3408
<     nexus_info->region.width,nexus_info->region.height,nexus_info->virtual_nexus,
<     exception);
---
>     nexus_info->region.width,nexus_info->region.height,
>     nexus_info->virtual_nexus,exception);
  • MagickCore/configure.c
  /*
    Search current directory.
  */
  (void) AppendValueToLinkedList(paths,ConstantString(""));
#endif
  {
    char
      *home;

    home=GetEnvironmentValue("XDG_CONFIG_HOME");
877a878
> #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__)
    if (home == (char *) NULL)
      home=GetEnvironmentValue("LOCALAPPDATA");
    if (home == (char *) NULL)
      home=GetEnvironmentValue("APPDATA");
    if (home == (char *) NULL)
      home=GetEnvironmentValue("USERPROFILE");
> #endif
  • MagickCore/display.c
    • const 修飾
125c125
<   *PageSizes[] =
---
>   *const PageSizes[] =
148c148
  • /MagickCore/nt-base.c
    • コード整形
1227,1228c1227,1228
< static int NTGhostscriptGetString(const char *name,BOOL *is_64_bit,
<   char *value,const size_t length)
  • MagickCore/module.c
    • configure.c と同じ。
    home=GetEnvironmentValue("XDG_CONFIG_HOME");
    if (home == (char *) NULL)
783a784
> #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__)
      home=GetEnvironmentValue("LOCALAPPDATA");
    if (home == (char *) NULL)
      home=GetEnvironmentValue("APPDATA");
    if (home == (char *) NULL)
      home=GetEnvironmentValue("USERPROFILE");
> #endif
  • MagickCore/opencl.c
    • コード整形
              home=GetEnvironmentValue("XDG_CACHE_HOME");
> #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__)
              if (home == (char *) NULL)
                home=GetEnvironmentValue("LOCALAPPDATA");
              if (home == (char *) NULL)
                home=GetEnvironmentValue("APPDATA");
              if (home == (char *) NULL)
                home=GetEnvironmentValue("USERPROFILE");
> #endif
            }
  • MagickCore/quantize.c
    • colormap_index に MaxMap 制限をつけた
3331,3332c3331,3332
<     colormap_index=(ssize_t *) AcquireQuantumMemory(image->colors+1,
<       sizeof(*colormap_index));
---
>     colormap_index=(ssize_t *) AcquireQuantumMemory(MagickMax(image->colors+1,
>       MaxMap),sizeof(*colormap_index));
3334,3335c3334,3335
<     colormap_index=(ssize_t *) AcquireQuantumMemory(MaxColormapSize+1,
<       sizeof(*colormap_index));
---
>     colormap_index=(ssize_t *) AcquireQuantumMemory(MagickMax(MaxColormapSize+1,
>       MaxMap),sizeof(*colormap_index));
  • MagickCore/resource.c
    • switch 分の後でまとめて処理してるのをやめて、case ごとに limit チェックする。(なんでだろ)
230a231,232
>       if ((limit == MagickResourceInfinity) || (size < limit))
>         status=MagickTrue;
266a269,270
>       if ((limit == MagickResourceInfinity) || (size < limit))
>         status=MagickTrue;
273,277c277,278
<       break;
<     }
<     case ThreadResource:
<     {
<       limit=resource_info.thread_limit;
---
>       if ((limit == MagickResourceInfinity) || (size < limit))
>         status=MagickTrue;
311a313,320
>     case ThreadResource:
>     {
>       limit=resource_info.thread_limit;
>       if ((limit == MagickResourceInfinity) ||
>           (resource_info.thread < (MagickOffsetType) limit))
>         status=MagickTrue;
>       break;
>     }
314a324,326
>       if ((limit == MagickResourceInfinity) ||
>           (resource_info.throttle < (MagickOffsetType) limit))
>         status=MagickTrue;
336a349,350
>       if ((limit == MagickResourceInfinity) || (size < limit))
>         status=MagickTrue;
358,359d371
<   if ((limit == MagickResourceInfinity) || (size < limit))
<     status=MagickTrue;
  • bMagickCore/widget-private.h
    • const 修飾
29c29
<   XCommandWidget(Display *,XWindows *,const char **,XEvent *),
---
>   XCommandWidget(Display *,XWindows *,const char *const *,XEvent *),
32c32
<   XMenuWidget(Display *,XWindows *,const char *,const char **,char *);
---
>   XMenuWidget(Display *,XWindows *,const char *,const char *const *,char *);
43c43
<   XListBrowserWidget(Display *,XWindows *,XWindowInfo *,const char **,
---
>   XListBrowserWidget(Display *,XWindows *,XWindowInfo *,const char *const *,
49c49
<     const MagickBooleanType,const char *,const char **);
---
>     const MagickBooleanType,const char *,const char *const *);
  • MagickCore/widget.c
    • const 修飾
1372c1372,1373
<             (void) XCommandWidget(display,windows,(const char **) NULL,event);
---
>             (void) XCommandWidget(display,windows,(const char *const *) NULL,
>               event);
<略>
  • coders/mat.c
    • 異常系の処理追加
1697a1698,1700
>         size_t
>           length;
>
1701c1704
<         (void) ExportQuantumPixels(image,(CacheView *) NULL,quantum_info,
---
>         length=ExportQuantumPixels(image,(CacheView *) NULL,quantum_info,
1703c1706,1709
<         (void) WriteBlob(image,image->rows,pixels);
---
>         if (length != image->columns)
>           break;
>         if (WriteBlob(image,image->rows,pixels) != (ssize_t) image->rows)
>           break;
1704a1711,1712
>       if (y < (ssize_t) image->columns)
>         break;
  • coders/meta.c
    • META 画像データ読み込みで IPTC の時に誤って 8bim プロファイルとして格納してた。
static Image *ReadMETAImage(const ImageInfo *image_info,
  ExceptionInfo *exception)
<略>
  if (LocaleCompare(image_info->magick,"IPTC") == 0)
    {
 <略>
1395c1395
<       (void) SetImageProfile(image,"8bim",profile,exception);
---
>       (void) SetImageProfile(image,"iptc",profile,exception);
  • coders/pdb.c
    • 色数に応じてビット数を狭める処理を入れた。今までは読んだビット数そのまま。
864c864
<   packet_size=(size_t) (image->depth > 8 ? 2 : 1);
---
>   packet_size=(size_t) (bits_per_pixel > 8 ? 2 : 1);
899c899
<   status=SetQuantumDepth(image,quantum_info,image->depth > 8 ? 16 : 8);
---
>   status=SetQuantumDepth(image,quantum_info,bits_per_pixel > 8 ? 16 : 8);
  • coders/ps2.c
    • リファクタリング。status の代入をギリギリ後ろで。
    • PixelsPerCentimeter の単位換算で、小数点を落としてたのを修正。型キャスト間違い
206,209d205
<   status=MagickTrue;
<   write_info=CloneImageInfo(image_info);
<   (void) CopyMagickString(write_info->filename,"GROUP4:",MagickPathExtent);
<   (void) CopyMagickString(write_info->magick,"GROUP4",MagickPathExtent);
212a209,211
>   write_info=CloneImageInfo(image_info);
>   (void) CopyMagickString(write_info->filename,"GROUP4:",MagickPathExtent);
>   (void) CopyMagickString(write_info->magick,"GROUP4",MagickPathExtent);
214a214
>   write_info=DestroyImageInfo(write_info);
218c218
<   write_info=DestroyImageInfo(write_info);
---
>   status=MagickTrue;
519,520c519,520
<         resolution.x=(size_t) (100.0*2.54*resolution.x+0.5)/100.0;
<         resolution.y=(size_t) (100.0*2.54*resolution.y+0.5)/100.0;
---
>         resolution.x=(double) (100.0*2.54*resolution.x+0.5)/100.0;
>         resolution.y=(double) (100.0*2.54*resolution.y+0.5)/100.0;
  • coders/psd.c
    • PSDSkipImage のコマ数指定を 0 数えから 1 数えに変更
fe   1665a1666
>     index,
1982a1984
>   index=0;
1986c1988
<         (PSDSkipImage(image_info,i) != MagickFalse))
---
>         (PSDSkipImage(image_info,++index) != MagickFalse))
  • coders/wmf.c
    • (API)->File->pmh->Inch の 0 チェック。スルー。
    • bounding_width, bounding_height の 0 チェック。エラー終了。
2736c2736
<   if ((API)->File->placeable)
---
>   if ((API)->File->placeable && (API)->File->pmh->Inch)
2761c2761,2766
<
---
>   if ((bounding_width == 0) || (bounding_height == 0))
>     {
>       ipa_device_close(API);
>       (void) wmf_api_destroy(API);
>       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
>     }

- coders/xwd.c
--  エラー処理の追加
--  型キャスト。型キャストによる桁あふれチェック。
--  WriteBlob の書き込み成功サイズチェック。
--   Bounding Box のキャッバス枠内チェック。
42a43
> #include "MagickCore/attribute.h"
239c240,248
<     ThrowReaderException(CorruptImageError,"CorruptImage");
---
>     ThrowReaderException(CorruptImageError,"ImproperImageHeader");
>   if ((header.bits_per_pixel == 0) || (header.bits_per_pixel > 32))
>     ThrowReaderException(CorruptImageError,"ImproperImageHeader");
<略>
482,483c491,492
<               index=ConstrainColormapIndex(image,(pixel >> red_shift) &
<                 red_mask,exception);
---
>               index=(Quantum) ConstrainColormapIndex(image,(ssize_t) (pixel >>
>                 red_shift) & red_mask,exception);
<略>
>     count,
737a748,752
>   if ((image->columns != (CARD32) image->columns) ||
>       (image->rows != (CARD32) image->rows))
>     ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
>   if ((image->storage_class == PseudoClass) && (image->colors > 256))
>     (void) SetImageType(image,TrueColorType,exception);
825,826c840,841
<             MSBOrderShort((unsigned char *) &colors[i].red,
<               3*sizeof(colors[i].red));
---
>             MSBOrderShort((unsigned char *) &colors[i].red,3*
>               sizeof(colors[i].red));
836c851,853
<         (void) WriteBlob(image,sz_XWDColor,(unsigned char *) &color);
---
>         count=WriteBlob(image,sz_XWDColor,(unsigned char *) &color);
>         if (count != (ssize_t) sz_XWDColor)
>           break;
878c895,898
<     (void) WriteBlob(image,(size_t) (q-pixels),pixels);
---
>     length=(size_t) (q-pixels);
>     count=WriteBlob(image,length,pixels);
>     if (count != (ssize_t) length)
>       break;
886c906
<   return(MagickTrue);
---
>   return(y < (ssize_t) image->rows ? MagickFalse :  MagickTrue);

ChangeLog

2019-04-12  7.0.8-40 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.8-40, GIT revision 15513:1a235853a:20190412

2019-04-10  7.0.8-40 Cristy  <quetzlzacatenango@image...>
  * Fixed a number of issues (reference
    https://imagemagick.org/discourse-server/viewforum.php?f=3).
  * Fixed a number of issues (reference
    https://github.com/ImageMagick/ImageMagick/issues).