ImageMagick-7.0.8-31差分

ImageMagick-7.0.8-31差分

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

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

まとめ

  • -trim が画像の virtual canvas に過敏に反応しないようにした。
気になる事

差分

  • -trim が画像の virtual canvas に過敏に反応しないようにした。
    • MagickCore/attribute.c
      • 入力 image と別に作業用の edge_image を別に作って、そこで処理。
244c244
<     *image_view;
---
>     *edge_view;
256a257,259
>   Image
>     *edge_image;
>
267a271,274
>   edge_image=CloneImage(image,0,0,MagickTrue,exception);
>   if (edge_image == (Image *) NULL)
>     return(bounds);
>   (void) ParseAbsoluteGeometry("0x0+0+0",&edge_image->page);
269,277c276,284
<   image_view=AcquireVirtualCacheView(image,exception);
<   edge.left=GetEdgeBackgroundFactor(image,image_view,WestGravity,1,0,0,0,
<     exception);
<   edge.right=GetEdgeBackgroundFactor(image,image_view,EastGravity,1,0,0,0,
<     exception);
<   edge.top=GetEdgeBackgroundFactor(image,image_view,NorthGravity,0,1,0,0,
<     exception);
<   edge.bottom=GetEdgeBackgroundFactor(image,image_view,SouthGravity,0,1,0,0,
<     exception);
---
>   edge_view=AcquireVirtualCacheView(edge_image,exception);
>   edge.left=GetEdgeBackgroundFactor(edge_image,edge_view,WestGravity,
>     1,0,0,0,exception);
>   edge.right=GetEdgeBackgroundFactor(edge_image,edge_view,EastGravity,
>     1,0,0,0,exception);
>   edge.top=GetEdgeBackgroundFactor(edge_image,edge_view,NorthGravity,
>     0,1,0,0,exception);
>   edge.bottom=GetEdgeBackgroundFactor(edge_image,edge_view,SouthGravity,
>     0,1,0,0,exception);
279c286
<   artifact=GetImageArtifact(image,"trim:percent-background");
---
>   artifact=GetImageArtifact(edge_image,"trim:percent-background");
297,303c304,312
    (同様に image の代わりに edge_image で処理)
357c370,371
<   image_view=DestroyCacheView(image_view);
---
>   edge_view=DestroyCacheView(edge_view);
>   edge_image=DestroyImage(edge_image);
361d374
<     {
364,365d376
<       SetGeometry(image,&bounds);
<     }

ChangeLog にない差分

  • MagickCore/cache.c
    • 今までは黙って NULL 返すだけのとこにエラー表示を追加。
    • MagickResouce のリークしそうだけど大丈夫?
static inline MagickBooleanType AcquireCacheNexusPixels(
  const CacheInfo *magick_restrict cache_info,const MagickSizeType length,
  NexusInfo *nexus_info,ExceptionInfo *exception)
{
  if (length != (MagickSizeType) ((size_t) length))
    {
>      (void) ThrowMagickException(exception,GetMagickModule(),
>        ResourceLimitError,"PixelCacheAllocationFailed","`%s'",
>        cache_info->filename);
      return(MagickFalse);
    }
4990c4995
<         ResourceLimitError,"MemoryAllocationFailed","`%s'",
---
続きを読む

ImageMagick-7.0.8-30差分

ImageMagick-7.0.8-30差分

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

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

まとめ

  • -define trim:percent-background=~ を追加 (7.0.8-29 で trim:blend として実装してたもの)
気になる事
  • -define trim:percent-background=0% を例にしてるが、内部で 100 で割ってるのでまずいような? 0だと結果変わらないし、単純に % が無視されるかもしれないが。strtod_l がどう動くのか。

差分

  • Support define to remove additional background from an image during a trim, e.g. -define trim:percent-background=0% -trim.
    • MagickCore/attribute.c
136,138c136,139
< static double GetEdgeBlendFactor(const Image *image,const CacheView *image_vie
w,
<   const GravityType gravity,const size_t width,const size_t height,
<   const ssize_t x_offset,const ssize_t y_offset,ExceptionInfo *exception)
---
> static double GetEdgeBackgroundFactor(const Image *image,
>   const CacheView *image_view,const GravityType gravity,const size_t width,
>   const size_t height,const ssize_t x_offset,const ssize_t y_offset,
>   ExceptionInfo *exception)
229c230
< static inline double GetMinBlendFactor(const EdgeInfo *edge)
---
> static inline double GetMinEdgeBackgroundFactor(const EdgeInfo *edge)
(沢山省略)
346,347c358,359
<   bounds.x=(ssize_t) count.left;
<   bounds.y=(ssize_t) count.top;
---
>   bounds.x=(ssize_t) vertex.left;
>   bounds.y=(ssize_t) vertex.top;
348a361,363
>     {
>       (void) ThrowMagickException(exception,GetMagickModule(),OptionWarning,
>         "GeometryDoesNotContainImage","`%s'",image->filename);
349a365
>     }

ChangeLog にない差分

(無し)

ChangeLog

> 2019-03-03  7.0.8-30 Cristy  <quetzlzacatenango@image...>
>   * Release ImageMagick version 7.0.8-30, GIT revision ...
>
> 2019-03-03  7.0.8-30 Cristy  <quetzlzacatenango@image...>
>   * Support define to remove additional background from an image during a
>     trim, e.g. -fuzz 5% -define trim:percent-background=0% -trim.

ImageMagick-6.9.10-28差分

ImageMagick-6.9.10-28差分

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

7 系同時リリースは ImageMagick-7.0.8-28

まとめ

気になる事

差分

  • WebP で -define webp:use-sharp-yuv=1 指定ができるように。
    • 実験用PNG素材

f:id:yoya:20190218235913p:plain
convert -size 256x256 xc:white -stroke red -draw "line 128 0 128 256 line 0 128 256 128 " red-line.png

    • WebP への変換結果。左が今までの。右は -define webp:use-sharp-yuv=1 指定。

f:id:yoya:20190218235714p:plain
-define webp:use-sharp-yuv=1 の検証

    • WebPの弱点として有名な色のくすみが大分改善される。なお少しだけファイルサイズ増える。(libwebp 的には v6.0.0 からの機能なので実は数年前からあります)
  • もう少し詳細 >

qiita.com

ChangeLog にない差分

<    #'CC' => 'gcc',
>    #'CC' => 'gcc -std=gnu99 -std=gnu99',
<    'PERLMAINCC'       => ' ',
>    'PERLMAINCC'       => ' -fopenmp',
  • PerlMagick/t/input.fits
大量のバイナリ差分
  • coders/cin.c
726a727,728
>   if (((MagickSizeType) image->columns*image->rows/8) > GetBlobSize(image))
>     ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");

- 
>       {
>         image->colors++;
1292a1295
>       }
  • coders/heic.c
    • coder のバージョンを設定。
395a396,398
> #if defined(LIBHEIF_VERSION)
>   entry->version=ConstantString(LIBHEIF_VERSION);
> #endif
  • coders/miff.c
    • 明示的なキャストを追加
    • 画像のパラメータチェックをより厳密に
    • LZMAMaxExtent の利用。
228,229c228,230
<           *index=ConstrainColormapIndex(image,((size_t) *p << 24) |
<             ((size_t) *(p+1) << 16) | ((size_t) *(p+2) << 8) | (size_t) *(p+3));
---
>           *index=ConstrainColormapIndex(image,(ssize_t) (((size_t) *p << 24) |
>             ((size_t) *(p+1) << 16) | ((size_t) *(p+2) << 8) |
>             (size_t) *(p+3)));
235c236
<           *index=ConstrainColormapIndex(image,(*p << 8) | *(p+1));
---
>           *index=ConstrainColormapIndex(image,(ssize_t) ((*p << 8) | *(p+1)));
241c242
<           *index=ConstrainColormapIndex(image,*p);
---
>           *index=ConstrainColormapIndex(image,(ssize_t) *p);
1116c1117
<     if ((LocaleCompare(id,"ImageMagick") != 0) || (image->depth > 128) ||
---
>     if ((LocaleCompare(id,"ImageMagick") != 0) ||
1120c1121,1122
<         (image->columns == 0) || (image->rows == 0))
---
>         (image->columns == 0) || (image->rows == 0) ||
>         (image->depth == 0) || (image->depth > 64))
1332a1335,1336
>     if (compress_extent < (packet_size*image->columns))
>       ThrowMIFFException(ResourceLimitError,"MemoryAllocationFailed");
1598c1602
<           extent=x;
---
>           extent=(size_t) x;
2619c2623
<             lzma_info.avail_out=packet_size*image->columns;
---
>             lzma_info.avail_out=LZMAMaxExtent(packet_size*image->columns);
  • coders/mpc.c
    • 画像のパラメータチェックをより厳密に
768c768
<     if ((LocaleCompare(id,"MagickCache") != 0) || (image->depth > 128) ||
---
>     if ((LocaleCompare(id,"MagickCache") != 0) ||
770,771c770,772
<         (image->compression == UndefinedCompression) || (image->columns == 0) ||
<         (image->rows == 0))
---
>         (image->compression == UndefinedCompression) ||
>         (image->columns == 0) || (image->rows == 0) ||
>         (image->depth == 0) || (image->depth > 64))
  • coders/mvg.c
--  mvg:vector-graphics の処理を追加。
--  ExpandBuffer の引数を逆に。掛け算の順序が変わるだけで影響はない?
>|c|
244c244
<   (void) SetImageArtifact(image,"MVG",draw_info->primitive);
---
>   (void) SetImageArtifact(image,"mvg:vector-graphics",draw_info->primitive);
356c356
<   value=GetImageArtifact(image,"MVG");
---
>   value=GetImageArtifact(image,"mvg:vector-graphics");
  • coders/pict.c
    • const 修飾追加。
329,330c329,330
< static unsigned char *ExpandBuffer(unsigned char *pixels,
<   MagickSizeType *bytes_per_line,const unsigned int bits_per_pixel)
---
> static const unsigned char *ExpandBuffer(const unsigned char *magick_restrict pixels,
>   const unsigned int bits_per_pixel,MagickSizeType *bytes_per_line)
331a332,334
>   register const unsigned char
>     *p;
>
336d338
<     *p,
405a408,410
>   register const unsigned char
>     *p;
>
410d414
<     *p,
482c486
<         p=ExpandBuffer(scanline,&number_pixels,bits_per_pixel);
---
>         p=ExpandBuffer(scanline,bits_per_pixel,&number_pixels);
521c525
<           p=ExpandBuffer(scanline+j+1,&number_pixels,bits_per_pixel);
---
>           p=ExpandBuffer(scanline+j+1,bits_per_pixel,&number_pixels);
531c535
<           p=ExpandBuffer(scanline+j+1,&number_pixels,bits_per_pixel);
---
>           p=ExpandBuffer(scanline+j+1,bits_per_pixel,&number_pixels);
(略)
  • coders/svg.c
    • trim 後に length が 0 の時は失敗と同じ処理
    • mvg:vector-graphics 対応。
681c681,682
<   if (trim != MagickFalse)
---
>   length=strlen(message);
>   if ((trim != MagickFalse) && (length != 0))
686d686
<       length=strlen(message);
4139c4139
<   value=GetImageArtifact(image,"MVG");
---
>   value=GetImageArtifact(image,"mvg:vector-graphics");
-- 
>|c|
1923a1924
>         (void) SetImageStorageClass(image,DirectClass);
1954c1955,1957
<             if (image->matte != MagickFalse)
---
>             if (image->matte == MagickFalse)
>               SetPixelOpacity(q,OpaqueOpacity);
>             else
2057a2061
>                   SetPixelOpacity(q,OpaqueOpacity);
2095a2100
>         (void) SetImageStorageClass(image,DirectClass);
2127c2132,2134
<             if (image->matte != MagickFalse)
---
>             if (image->matte == MagickFalse)
>               SetPixelOpacity(q,OpaqueOpacity);
>             else
  • coders/webp.c
    • バージョンによる機能切り替えの修正。
484,486c484,486
<     (WebPGetDecoderVersion() >> 16) & 0xff,
<     (WebPGetDecoderVersion() >> 8) & 0xff,
<     (WebPGetDecoderVersion() >> 0) & 0xff,WEBP_DECODER_ABI_VERSION);
---
>     (WebPGetEncoderVersion() >> 16) & 0xff,
>     (WebPGetEncoderVersion() >> 8) & 0xff,
>     (WebPGetEncoderVersion() >> 0) & 0xff,WEBP_ENCODER_ABI_VERSION);
552c552
< #if WEBP_DECODER_ABI_VERSION >= 0x0100
---
> #if WEBP_ENCODER_ABI_VERSION >= 0x0100
640c640
< #if WEBP_DECODER_ABI_VERSION >= 0x0100
---
> #if WEBP_ENCODER_ABI_VERSION >= 0x0100
669c669
< #if WEBP_DECODER_ABI_VERSION >= 0x0200
---
> #if WEBP_ENCODER_ABI_VERSION >= 0x0200
723c723
< #if WEBP_DECODER_ABI_VERSION >= 0x0201
---
> #if WEBP_ENCODER_ABI_VERSION >= 0x0201
736c736
< #if WEBP_DECODER_ABI_VERSION >= 0x020e
---
> #if WEBP_ENCODER_ABI_VERSION >= 0x020e
834c834
< #if WEBP_DECODER_ABI_VERSION >= 0x0100
---
> #if WEBP_ENCODER_ABI_VERSION >= 0x0100
  • coders/wpg.c
    • カラーマップのサイズ変更の処理をエラー対処つきで。
1113a1114
>   image->storage_class=DirectClass;
1172c1173
<               if (!AcquireImageColormap(image,image->colors))
---
>               if (AcquireImageColormap(image,image->colors) == MagickFalse)
1259,1260c1260,1276
<                       image->colormap=(PixelPacket *) ResizeQuantumMemory(
<                         image->colormap,(size_t) (one << bpp),
---
>                     {
>                       PixelPacket
>                         *colormap;
>
>                       size_t
>                         colors;
>
>                       colormap=image->colormap;
>                       colors=image->colors;
>                       image->colormap=(PixelPacket *) NULL;
>                       if (AcquireImageColormap(image,one << bpp) == MagickFalse)
>                         {
>                           colormap=(PixelPacket *)
>                             RelinquishMagickMemory(colormap);
>                           goto NoMemory;
>                         }
>                       (void) memcpy(image->colormap,colormap,colors*
1261a1278,1280
>                       colormap=(PixelPacket *)
>                         RelinquishMagickMemory(colormap);
>                     }
  • magick/annotate.c
    • リファイン?
1530a1531
>     glyph.image=0;
1716c1717,1718
<     if (last_glyph.id != 0)
---
>     if (last_glyph.image != 0)
>       {
1717a1720,1721
>         last_glyph.image=0;
>       }
1725,1726c1729,1733
<   if (last_glyph.id != 0)
<     FT_Done_Glyph(last_glyph.image);
---
>   if (glyph.image != 0)
>     {
>       FT_Done_Glyph(glyph.image);
>       glyph.image=0;
>     }
  • magick/draw.c
    • dash_pattern のオブジェクトサイズを大きめにとる。あとzero初期化も。
    • mvg:vector-graphics へのセット。
    • ConstrainCoordinate。値のクランプ
342c342
<       clone_info->dash_pattern=(double *) AcquireQuantumMemory((size_t) (x+1),
---
>       clone_info->dash_pattern=(double *) AcquireQuantumMemory((size_t) (2*x+2),
346a347,348
>       (void) memset(clone_info->dash_pattern,0,(size_t) (2*x+2)*
>         sizeof(*clone_info->dash_pattern));
1795d1796
<         n++;
2474c2475
<   (void) SetImageArtifact(image,"MVG",primitive);
---
>   (void) SetImageArtifact(image,"mvg:vector-graphics",primitive);
4907a4909,4917
> static inline double ConstrainCoordinate(double x)
> {
>   if (x < -SSIZE_MAX)
>     return(-SSIZE_MAX);
>   if (x > SSIZE_MAX)
>     return(SSIZE_MAX);
>   return(x);
> }
>
5049,5050c5059,5060
<   x=(ssize_t) ceil(primitive_info->point.x-0.5);
<   y=(ssize_t) ceil(primitive_info->point.y-0.5);
---
>   x=(ssize_t) ceil(ConstrainCoordinate(primitive_info->point.x-0.5));
>   y=(ssize_t) ceil(ConstrainCoordinate(primitive_info->point.y-0.5));
  • magick/image.c
  • -
1776c1776
<         offset+=strlen(pattern)-4;
---
>         offset+=strlen(pattern)-strlen(value)+3;
  • www/assets/magick.css
    • Bootstrap バージョン変更
2,4c2,4
<  * Bootstrap v4.2.1 (https://getbootstrap.com/)
<  * Copyright 2011-2018 The Bootstrap Authors
<  * Copyright 2011-2018 Twitter, Inc.
---
>  * Bootstrap v4.3.0 (https://getbootstrap.com/)
>  * Copyright 2011-2019 The Bootstrap Authors
>  * Copyright 2011-2019 Twitter, Inc.
6c6
  • www/assets/magick.js
    • Bootstrap バージョン変更
2,3c2,3
<   * Bootstrap v4.2.1 (https://getbootstrap.com/)
<   * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstr
ap/graphs/contributors)
---
>   * Bootstrap v4.3.0 (https://getbootstrap.com/)
>   * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstr
ap/graphs/contributors)
6c6

ChangeLog

2019-02-12  6.9.10-28 Cristy  <quetzlzacatenango@image...>
  * Fixed a number of issues (reference
    https://github.com/ImageMagick/ImageMagick/issues).

 

IO_GIF 1.0.1 をリリースしました

sample/gifdump.php で LocalColorTable の表示を忘れていたので、追加しました。
だいたい GIF のトラブルで多いのはこれ周りなので、必須機能なのに忘れてました。

ImageMagick-6.9.10-27差分

ImageMagick-6.9.10-27差分

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

7 系同時リリースは ImageMagick-7.0.8-27

まとめ

  • image.gif[2-3] のような scene geometry の処理を修正。

https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=35435

  • BMP 読み込みで ICC プロファイルを解釈するようになった。BMPv5 の機能。
気になる事

珍しく PerlMagick/t/input.fits に大量の差分がある。

差分

  • subimage レンジ適切に扱う変更パッチ。 (例. image.gif[2-3]).

ChangeLog にない差分

  • PerlMagick/t/input.fits
1,76c1
< SIMPLE  =
(よく分からないバイナリが大量に)
  • coders/bmp.c
    • BMP 読み込みで ICC プロファイルを解釈できるようにした。
526a527,528
>     profile_data,
>     profile_size,
630a633,634
>     profile_data=0;
>     profile_size=0;
829,830c833,834
<             (void) ReadBlobLSBLong(image);  /* Profile data */
<             (void) ReadBlobLSBLong(image);  /* Profile size */
---
>             profile_data=(MagickOffsetType) ReadBlobLSBLong(image);
>             profile_size=(MagickOffsetType) ReadBlobLSBLong(image);
1451a1456,1497
>       Read embeded ICC profile
>     */
>     if ((bmp_info.colorspace == 0x4D424544L) && (profile_data > 0) &&
>         (profile_size > 0))
>       {
>         StringInfo
>           *profile;
>
>         unsigned char
>           *datum;
>
>         offset=start_position+14+profile_data;
>         if ((offset < TellBlob(image)) ||
>             (SeekBlob(image,offset,SEEK_SET) != offset) ||
>             (GetBlobSize(image) < (MagickSizeType) (offset+profile_size)))
>           ThrowReaderException(CorruptImageError,"ImproperImageHeader");
>         profile=AcquireStringInfo((size_t) profile_size);
>         if (profile == (StringInfo *) NULL)
>           ThrowReaderException(CorruptImageError,"MemoryAllocationFailed");
>         datum=GetStringInfoDatum(profile);
>         if (ReadBlob(image,(size_t) profile_size,datum) == (ssize_t) profile_size)
>           {
>             MagickOffsetType
>               profile_size_orig;
>
>             /*
>              Trimming padded bytes.
>             */
>             profile_size_orig=(MagickOffsetType) datum[0] << 24;
>             profile_size_orig|=(MagickOffsetType) datum[1] << 16;
>             profile_size_orig|=(MagickOffsetType) datum[2] << 8;
>             profile_size_orig|=(MagickOffsetType) datum[3];
>             if (profile_size_orig < profile_size)
>               SetStringInfoLength(profile,(size_t) profile_size_orig);
>             if (image->debug != MagickFalse)
>               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
>                 "Profile: ICC, %u bytes",(unsigned int) profile_size_orig);
>             (void) SetImageProfile(image,"icc",profile);
>           }
>         profile=DestroyStringInfo(profile);
>       }
>     /*

ChangeLog

2019-02-09  6.9.10-27 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 6.9.10-27, GIT revision 14197:4e00248f4:20190209

2019-02-09  6.9.10-27 Cristy  <quetzlzacatenango@image...>
  * Mod patch to properly handle subimage ranges (e.g. image.gif[2-3]).

 

ImageMagick-6.9.10-26差分

ImageMagick-6.9.10-26差分

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

7 系同時リリースは ImageMagick-7.0.8-26

まとめ

  • issue の解決
気になる事
  • BMP形式の ICCプロファイル書き込み対応した。(というか僕がコミットした)
  • libwebp 0.6.0 から -define webp:use-sharp-yuv=1 が使える。はずがミスってて実際は動かない。

差分

ChangeLog にない差分

  • coders/bmp.c
    • BMPICC プロファイル出力対応
1646a1647
>     profile_data,
>     profile_size,
>     profile_size_pad;
>
2197a2203,2213
>     profile_data=0;
>     profile_size=0;
>     profile_size_pad=0;
>     if (profile) {
>       profile_data=(MagickOffsetType) bmp_info.file_size-14;  /* from head of BMP info header */
>       profile_size=(MagickOffsetType) GetStringInfoLength(profile);
>       if (profile_size%4) {
>         profile_size_pad=4-(profile_size%4);
>       }
>       bmp_info.file_size+=profile_size+profile_size_pad;
>     }
2239a2256,2258
>         if (profile) {
>           (void) WriteBlobLSBLong(image,0x4D424544U);  /* PROFILE_EMBEDDED */
>         } else {
2240a2260
>         }
2303,2304c2323,2325
<             (void) WriteBlobLSBLong(image,0x00);  /* dummy profile data */
<             (void) WriteBlobLSBLong(image,0x00);  /* dummy profile length */
---
>             (void) WriteBlobLSBLong(image,(unsigned int) profile_data);
>             (void) WriteBlobLSBLong(image,(unsigned int) (profile_size+
>               profile_size_pad));
2354a2376,2385
>     if (profile) {
>       if (image->debug != MagickFalse)
>         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
>           "  Profile:  %g bytes",(double) profile_size+profile_size_pad);
>       (void) WriteBlob(image,(size_t) profile_size,GetStringInfoDatum(profile));
>       if (profile_size_pad) {  /* padding for 4 bytes multiple */
>         (void) WriteBlob(image,(size_t) profile_size_pad,(unsigned char *)
>           "\0\0\0");
>       }
>     }
3784c3784,3791
<                (void) SetImageProperty(image,text[i].key,value);
---
>               {
>                 char
>                   key[MaxTextExtent];
>
>                 (void) FormatLocaleString(key,MaxTextExtent,"png:%s",
>                   text[i].key);
>                 (void) SetImageProperty(image,key,value);
>               }
(略)
3854c3910
<   value=strtol(point,&p,10);
---
>   value=(ssize_t) strtol(point,&p,10);
(略)
268a274,356
> static Image *RenderSVGImage(const ImageInfo *image_info,Image *image,
>   ExceptionInfo *exception)
  • coders/tiff.c
    • WRITE 処理での PHOTOMETRIC_SEPARATED の考慮漏れの修正
3652a3653
>              (photometric == PHOTOMETRIC_SEPARATED) ||
3674a3676
>              (photometric == PHOTOMETRIC_SEPARATED) ||
3688a3691
>              (photometric == PHOTOMETRIC_SEPARATED) ||
3699a3703
>              (photometric == PHOTOMETRIC_SEPARATED) ||
3714a3719
>              (photometric == PHOTOMETRIC_SEPARATED) ||
  • coders/webp.c
    • libweb-0.6.0 から追加された use_sharp_yuv を使えるようにするはずが。。。
      • 現状 DECODER_ABI は最新が 0208 だし、RGB=>YUV の encode 機能なので ENCODER_ABI (こちらは 0.6.0 から 020e)と間違えてるっぽい。あとで修正PR送っとく。
735a736,740
> #if WEBP_DECODER_ABI_VERSION >= 0x020e
>   value=GetImageOption(image_info,"webp:use-sharp-yuv");
>   if (value != (char *) NULL)
>     configure.use_sharp_yuv=StringToInteger(value);
  • magick/constitute.c
    • ReadImage で scene geometry なのに "%d-%d" 形式になってない場合だけ CloneImages で作り直す。
636a637,641
>       int
>         first_scene,
>         last_scene,
>         n;
>
639a645,647
>       n=sscanf(read_info->scenes,"%d-%d",&first_scene,&last_scene);
>       if (n != 2)
>         {
643c651,652
<           "SubimageSpecificationReturnsNoImages","`%s'",read_info->filename);
---
>               "SubimageSpecificationReturnsNoImages","`%s'",
>               read_info->filename);
649a659
>     }
diff -rBw ImageMagick-6.9.10-25/magick/draw.c ImageMagick-6.9.10-26/magick/draw.c
2462c2462
<         return(status == 0 ? MagickFalse : MagickTrue);
---
>         return(status);
  • magick/draw.c
    • シンプルにした。
2462c2462
<         return(status == 0 ? MagickFalse : MagickTrue);
---
>         return(status);
  • magick/locale.c
    • リファイン。nt-base.h とも絡む。
288d287
< #if defined(MAGICKCORE_HAVE_NEWLOCALE)
291,294d289
< #elif defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__)
<   if (c_locale != (locale_t) NULL)
<     _free_locale(c_locale);
< #endif
1529,1530c1524,1525
<   if (c_locale == (locale_t) NULL)
<     return(tolower(c));
---
> #if defined(MAGICKCORE_LOCALE_SUPPORT)
>   if (c_locale != (locale_t) NULL)
1531a1527,1528
> #endif
>   return(tolower(c));
1665,1666c1662,1663
<   if (c_locale == (locale_t) NULL)
<     return(toupper(c));
---
> #if defined(MAGICKCORE_LOCALE_SUPPORT)
>   if (c_locale != (locale_t) NULL)
1667a1665,1666
> #endif
>   return(toupper(c));
  • magick/nt-base.h
    • Windows 用に define で freelocale に統一。
103a104,106
> #if !defined(freelocale)
> #  define freelocale  _free_locale
> #endif
  • magick/pixel-accessor.h
    • キャスト
114c114
<     return(0);
---
>     return((Quantum) 0);

ChangeLog

2019-02-03  6.9.10-27 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 6.9.10-27, GIT revision 14180:153da6bd6:20190203

2019-02-02  6.9.10-26 Cristy  <quetzlzacatenango@image...>
  * Fixed a number of issues (reference
    https://github.com/ImageMagick/ImageMagick/issues).

 

ImageMagick-6.9.10-25差分

ImageMagick-6.9.10-25差分

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

7 系同時リリースは ImageMagick-7.0.8-25

まとめ

気になる事
  • tolower/toupper の代わりに Locale 関数の LocaleLowercase/LocaleUppercase を呼ぶようにした箇所が沢山ある。
    • これで大文字や小文字への変換が直感的になるケースがある?

You may not use this file except in compliance with the License.
obtain a copy of the License at

これを

You may not use this file except in compliance with the License. You may
obtain a copy of the License at

に書き換えてる。大量に。

差分

ChangeLog にない差分

  • coders/bmp.c
    • 画像が途中で途切れてないかのチェックの計算ミス。ここスルーしても別の箇所でエラーになるので恐らく実害ない。
    • bmp_colormap のメモリ確保に失敗した時に、pixel_info を解放してなかった。これも意図的には作るのは難しい。
967a968,969
>     if ((MagickSizeType) (length/256) > GetBlobSize(image))
>       ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
971,972d972
<         if ((MagickSizeType) length > GetBlobSize(image))
<           ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
2321a2322,2323
>           {
>             pixel_info=RelinquishVirtualMemory(pixel_info);
2322a2325
>           }
  • coders/dib.c
    • dib_colormap のメモリ確保出来ない時に、 pixels がメモリリークしてた。(カラーマップは固定でそんな大きくないので意図的に発生させるのは難しい。実害はなさそう)
1382a1383,1384
>             {
>               pixels=(unsigned char *) RelinquishMagickMemory(pixels);
1383a1386
>             }
  • coders/fits.c
    • tolower の代わりに Locale関数の方を呼ぶ
334c334
<         keyword[i]=tolower((int) ((unsigned char) keyword[i]));
---
>         keyword[i]=LocaleLowercase((int) ((unsigned char) keyword[i]));
  • coders/json.c
    • tolower の代わりに Locale関数の方を呼ぶ
1113c1113
<       *target=(char) toupper((int) ((unsigned char) *target));
---
>       *target=(char) LocaleUppercase((int) ((unsigned char) *target)); 
  • coders/meta.c

181c181< i=toupper(i);

    • -

> i=LocaleUppercase(i);
184c184< j=toupper(j);

    • -

> j=LocaleUppercase(j);
193c193< return(toupper*1;

    • -

> return(LocaleUppercase*2;
|

  • coders/psd.c
    • ReadPSDLayersInternal で top/left の右下に bottom/right がある事のチェックを追加。
1639,1640c1639,1642
<           x,
<           y;
---
>           top,
>           left,
>           bottom,
>           right;
1645,1650c1647,1660
<         layer_info[i].page.y=(ssize_t) ReadBlobSignedLong(image);
<         layer_info[i].page.x=(ssize_t) ReadBlobSignedLong(image);
<         y=(ssize_t) ReadBlobSignedLong(image);
<         x=(ssize_t) ReadBlobSignedLong(image);
<         layer_info[i].page.width=(size_t) (x-layer_info[i].page.x);
<         layer_info[i].page.height=(size_t) (y-layer_info[i].page.y);
---
>         top=(ssize_t) ReadBlobSignedLong(image);
>         left=(ssize_t) ReadBlobSignedLong(image);
>         bottom=(ssize_t) ReadBlobSignedLong(image);
>         right=(ssize_t) ReadBlobSignedLong(image);
>         if ((right < left) || (bottom < top))
>           {
>             layer_info=DestroyLayerInfo(layer_info,number_layers);
>             ThrowBinaryException(CorruptImageError,"ImproperImageHeader",
>               image->filename);
>           }
>         layer_info[i].page.y=top;
>         layer_info[i].page.x=left;
>         layer_info[i].page.width=(size_t) (right-left);
>         layer_info[i].page.height=(size_t) (bottom-top);
2707a2718,2719
>           compressed_pixels=(unsigned char *) RelinquishMagickMemory(
>             compressed_pixels);
  • coders/sixel.c
    • sixel_decode で失敗した時に sixel_pixels のメモリ解放を忘れてた。メモリリークになりそう?
1058a1059
>       sixel_pixels=(unsigned char *) RelinquishMagickMemory(sixel_pixels);
  • coders/tiff.c
    • 主に宣言型の整理。VMS で JPEGCompression を有効にした。(なんで VMS だけ?)
    • 動作に影響がないリファイン。ORIENTATION_TOPLEFT を初期値的に入れて image->orientation がある時に上書きしてたけど、image-orientation 処理の else 説で TOPLEFT を入れるようにした。
41a42,44
> #ifdef __VMS
> #define JPEG_SUPPORT 1
> #endif
90c93
< #  include "tiffconf.h"
---
> #  include <tiffconf.h>
92,93c95,96
< # include "tiff.h"
< # include "tiffio.h"
---
> # include <tiff.h>
> # include <tiffio.h>
230,231c233
<   /* Setting the mode to a value that won't change the colorspace */
<   info->mode=10;
---
>   info->mode=10; /* Set mode to a value that won't change the colorspace */
329c331
< static inline size_t WriteLSBLong(FILE *file,const size_t value)
---
> static inline size_t WriteLSBLong(FILE *file,const unsigned int value)
396a399,400
>   if (length != 10)
>     ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
407c411
<   length=WriteLSBLong(file,(size_t) strip_offset);
---
>   length=WriteLSBLong(file,(unsigned int) strip_offset);
409c413
<   length=WriteLSBLong(file,(size_t) image_info->orientation);
---
>   length=WriteLSBLong(file,(unsigned int) image_info->orientation);
416c420
<   length=WriteLSBLong(file,(size_t) (strip_offset-8));
---
>   length=WriteLSBLong(file,(unsigned int) (strip_offset-8));
418c422
<   length=WriteLSBLong(file,(size_t) (strip_offset-8));
---
>   length=WriteLSBLong(file,(unsigned int) (strip_offset-8));
421c425
<   length=WriteLSBLong(file,(size_t) (image->x_resolution+0.5));
---
>   length=WriteLSBLong(file,(unsigned int) image->x_resolution);
1044c1048
< static void TIFFReadPhotoshopLayers(Image* image,const ImageInfo *image_info,
---
> static void TIFFReadPhotoshopLayers(const ImageInfo *image_info,Image *image,
1055a1060,1062
>   ImageInfo
>     *clone_info;
>
1096c1103,1106
<   (void) ReadPSDLayers(layers,image_info,&info,MagickFalse,exception);
---
   clone_info=CloneImageInfo(image_info);
>   clone_info->number_scenes=0;
>   (void) ReadPSDLayers(layers,clone_info,&info,MagickFalse,exception);
>   clone_info=DestroyImageInfo(clone_info);
2177c2187
<   TIFFReadPhotoshopLayers(image,image_info,exception);
---
>   TIFFReadPhotoshopLayers(image_info,image,exception);
3579d3588
<     (void) TIFFSetField(tiff,TIFFTAG_ORIENTATION,ORIENTATION_TOPLEFT);
3787a3797,3798
>     else
>       (void) TIFFSetField(tiff,TIFFTAG_ORIENTATION,ORIENTATION_TOPLEFT);
  • coders/ttf.c
    • 開発中の試行錯誤?
54a55
> #include "magick/resource_.h"
255c256,257
<   draw_info->font=AcquireString(image->filename);
---
>   draw_info->font=AcquireString("");
>   (void) ImageToFile(image,draw_info->font,exception);
289a292
>   (void) RelinquishUniqueFileResource(draw_info->font);
  • /magick/configure.c
    • AddConfigureKey で処理を整理。
(ごっそり変わってる)
  • magick/display.c
    • toupper で Locale 関数を使う。
14482c14482,14483
<   class_hints->res_class[0]=(char) toupper((int) class_hints->res_class[0]);
---
>   class_hints->res_class[0]=(char) LocaleUppercase((int)
>     class_hints->res_class[0]);
  • magick/fx.c
    • CharcoalImage で ClampImage をはじめに追加。あとエラーハンドリングを真面目にやる。(どれも失敗する事なさそうなメソッドだけど)
93a94
> #include "magick/threshold.h"
630a632,634
>   MagickBooleanType
>     status;
>
639a644,646
>   charcoal_image=(Image *) NULL;
>   status=ClampImage(edge_image);
>   if (status != MagickFalse)
644,646c651,657
<   (void) NormalizeImage(charcoal_image);
<   (void) NegateImage(charcoal_image,MagickFalse);
<   (void) GrayscaleImage(charcoal_image,image->intensity);
---
>   status=NormalizeImage(charcoal_image);
>   if (status != MagickFalse)
>     status=NegateImage(charcoal_image,MagickFalse);
>   if (status != MagickFalse)
>     status=GrayscaleImage(charcoal_image,image->intensity);
>   if (status == MagickFalse)
>     charcoal_image=DestroyImage(charcoal_image);
4631,4633c4642,4648
<   (void) NormalizeImage(dodge_image);
<   (void) NegateImage(dodge_image,MagickFalse);
<   (void) TransformImage(&dodge_image,(char *) NULL,"50%");
---
>   status=ClampImage(dodge_image);
>   if (status != MagickFalse)
>     status=NormalizeImage(dodge_image);
>   if (status != MagickFalse)
>     status=NegateImage(dodge_image,MagickFalse);
>   if (status != MagickFalse)
>     status=TransformImage(&dodge_image,(char *) NULL,"50%");

ChangeLog

2019-01-27  6.9.10-25 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 6.9.10-25, GIT revision 14167:183ec9d88:20190127

2019-01-19  6.9.10-25 Cristy  <quetzlzacatenango@image...>
  * Eliminate spurious font warning (reference
    https://github.com/ImageMagick/ImageMagick/issues/1458).
  * Support HEIC EXIF & XMP profiles.

 

*1:int) *p)-toupper((int) *q

*2:int) *p)-LocaleUppercase((int) *q