Skip to content

Commit dc409af

Browse files
web-flowMolotovCherry
authored andcommitted
Update ImageMagick from 7.1.0-35 -> 7.1.0-36
1 parent b51192b commit dc409af

File tree

636 files changed

+78
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

636 files changed

+78
-40
lines changed

Android.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ OPENCL_INCLUDE_PATH := $(OPENCL_PATH)/qualcomm/include
3030

3131
LTDL_LIB_PATH := $(LOCAL_PATH)/libltdl-2.4.6
3232

33-
IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.0-35
33+
IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.0-36
3434
IMAGE_MAGICK := $(LOCAL_PATH)/$(IMAGE_MAGICK_BASEDIR)
3535

3636
JPEG_LIB_PATH := $(LOCAL_PATH)/libjpeg-turbo-2.0.2

ImageMagick-7.1.0-35/Magick++/lib/Magick++/Include.h ImageMagick-7.1.0-36/Magick++/lib/Magick++/Include.h

+14-14
Original file line numberDiff line numberDiff line change
@@ -137,24 +137,24 @@ namespace MagickCore
137137
# endif
138138
# if defined(MAGICKCORE_HEIC_DELEGATE)
139139
# pragma comment(lib, "CORE_DB_aom_.lib")
140-
# pragma comment(lib, "CORE_DB_libde265_.lib")
141-
# pragma comment(lib, "CORE_DB_libheif_.lib")
140+
# pragma comment(lib, "CORE_DB_de265_.lib")
141+
# pragma comment(lib, "CORE_DB_heif_.lib")
142142
# endif
143143
# if defined(MAGICKCORE_LZMA_DELEGATE)
144-
# pragma comment(lib, "CORE_DB_liblzma_.lib")
144+
# pragma comment(lib, "CORE_DB_lzma_.lib")
145145
# endif
146146
# if defined(MAGICKCORE_RAW_R_DELEGATE)
147-
# pragma comment(lib, "CORE_DB_libraw_.lib")
147+
# pragma comment(lib, "CORE_DB_raw_.lib")
148148
# endif
149149
# if defined(MAGICKCORE_RSVG_DELEGATE)
150150
# pragma comment(lib, "CORE_DB_croco_.lib")
151-
# pragma comment(lib, "CORE_DB_librsvg_.lib")
151+
# pragma comment(lib, "CORE_DB_rsvg_.lib")
152152
# endif
153153
# if defined(MAGICKCORE_XML_DELEGATE)
154-
# pragma comment(lib, "CORE_DB_libxml_.lib")
154+
# pragma comment(lib, "CORE_DB_xml_.lib")
155155
# endif
156156
# if defined(MAGICKCORE_ZIP_DELEGATE)
157-
# pragma comment(lib, "CORE_DB_libzip_.lib")
157+
# pragma comment(lib, "CORE_DB_zip_.lib")
158158
# endif
159159
# if defined(MAGICKCORE_LQR_DELEGATE)
160160
# pragma comment(lib, "CORE_DB_ffi_.lib")
@@ -226,24 +226,24 @@ namespace MagickCore
226226
# endif
227227
# if defined(MAGICKCORE_HEIC_DELEGATE)
228228
# pragma comment(lib, "CORE_RL_aom_.lib")
229-
# pragma comment(lib, "CORE_RL_libde265_.lib")
230-
# pragma comment(lib, "CORE_RL_libheif_.lib")
229+
# pragma comment(lib, "CORE_RL_de265_.lib")
230+
# pragma comment(lib, "CORE_RL_heif_.lib")
231231
# endif
232232
# if defined(MAGICKCORE_LZMA_DELEGATE)
233-
# pragma comment(lib, "CORE_RL_liblzma_.lib")
233+
# pragma comment(lib, "CORE_RL_lzma_.lib")
234234
# endif
235235
# if defined(MAGICKCORE_RAW_R_DELEGATE)
236-
# pragma comment(lib, "CORE_RL_libraw_.lib")
236+
# pragma comment(lib, "CORE_RL_raw_.lib")
237237
# endif
238238
# if defined(MAGICKCORE_RSVG_DELEGATE)
239239
# pragma comment(lib, "CORE_RL_croco_.lib")
240-
# pragma comment(lib, "CORE_RL_librsvg_.lib")
240+
# pragma comment(lib, "CORE_RL_rsvg_.lib")
241241
# endif
242242
# if defined(MAGICKCORE_XML_DELEGATE)
243-
# pragma comment(lib, "CORE_RL_libxml_.lib")
243+
# pragma comment(lib, "CORE_RL_xml_.lib")
244244
# endif
245245
# if defined(MAGICKCORE_ZIP_DELEGATE)
246-
# pragma comment(lib, "CORE_RL_libzip_.lib")
246+
# pragma comment(lib, "CORE_RL_zip_.lib")
247247
# endif
248248
# if defined(MAGICKCORE_LQR_DELEGATE)
249249
# pragma comment(lib, "CORE_RL_ffi_.lib")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

ImageMagick-7.1.0-35/MagickCore/quantize.c ImageMagick-7.1.0-36/MagickCore/quantize.c

+51-11
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196
#include "MagickCore/monitor-private.h"
197197
#include "MagickCore/option.h"
198198
#include "MagickCore/pixel-accessor.h"
199+
#include "MagickCore/property.h"
199200
#include "MagickCore/quantize.h"
200201
#include "MagickCore/quantum.h"
201202
#include "MagickCore/quantum-private.h"
@@ -2380,6 +2381,17 @@ static KmeansInfo **DestroyKmeansTLS(KmeansInfo **kmeans_info)
23802381
return(kmeans_info);
23812382
}
23822383

2384+
static int DominantColorCompare(const void *x,const void *y)
2385+
{
2386+
PixelInfo
2387+
*pixel_1,
2388+
*pixel_2;
2389+
2390+
pixel_1=(PixelInfo *) x;
2391+
pixel_2=(PixelInfo *) y;
2392+
return((int) pixel_2->count-(int) pixel_1->count);
2393+
}
2394+
23832395
static KmeansInfo **AcquireKmeansTLS(const size_t number_colors)
23842396
{
23852397
KmeansInfo
@@ -2461,12 +2473,18 @@ MagickExport MagickBooleanType KmeansImage(Image *image,
24612473
CacheView
24622474
*image_view;
24632475

2476+
char
2477+
tuple[MagickPathExtent];
2478+
24642479
const char
24652480
*colors;
24662481

24672482
double
24682483
previous_tolerance;
24692484

2485+
Image
2486+
*dominant_image;
2487+
24702488
KmeansInfo
24712489
**kmeans_pixels;
24722490

@@ -2475,9 +2493,11 @@ MagickExport MagickBooleanType KmeansImage(Image *image,
24752493
status;
24762494

24772495
size_t
2478-
n,
24792496
number_threads;
24802497

2498+
ssize_t
2499+
n;
2500+
24812501
assert(image != (Image *) NULL);
24822502
assert(image->signature == MagickCoreSignature);
24832503
assert(exception != (ExceptionInfo *) NULL);
@@ -2505,7 +2525,7 @@ MagickExport MagickBooleanType KmeansImage(Image *image,
25052525
quantize_info->colorspace=image->colorspace;
25062526
quantize_info->number_colors=number_colors;
25072527
quantize_info->dither_method=NoDitherMethod;
2508-
n=number_colors;
2528+
n=(ssize_t) number_colors;
25092529
for (depth=1; n != 0; depth++)
25102530
n>>=2;
25112531
cube_info=GetCubeInfo(quantize_info,depth,number_colors);
@@ -2541,7 +2561,7 @@ MagickExport MagickBooleanType KmeansImage(Image *image,
25412561
status=AcquireImageColormap(image,number_colors,exception);
25422562
if (status == MagickFalse)
25432563
return(status);
2544-
for (n=0, p=colors; n < image->colors; n++)
2564+
for (n=0, p=colors; n < (ssize_t) image->colors; n++)
25452565
{
25462566
const char
25472567
*q;
@@ -2560,7 +2580,7 @@ MagickExport MagickBooleanType KmeansImage(Image *image,
25602580
}
25612581
p=q+1;
25622582
}
2563-
if (n < image->colors)
2583+
if (n < (ssize_t) image->colors)
25642584
{
25652585
RandomInfo
25662586
*random_info;
@@ -2569,7 +2589,7 @@ MagickExport MagickBooleanType KmeansImage(Image *image,
25692589
Seed clusters from random values.
25702590
*/
25712591
random_info=AcquireRandomInfo();
2572-
for ( ; n < image->colors; n++)
2592+
for ( ; n < (ssize_t) image->colors; n++)
25732593
{
25742594
(void) QueryColorCompliance("#000",AllCompliance,image->colormap+n,
25752595
exception);
@@ -2592,10 +2612,10 @@ MagickExport MagickBooleanType KmeansImage(Image *image,
25922612
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
25932613
image->filename);
25942614
previous_tolerance=0.0;
2595-
verbose=IsStringTrue(GetImageArtifact(image,"debug"));
2615+
verbose=IsStringTrue(GetImageArtifact(image,"verbose"));
25962616
number_threads=(size_t) GetMagickResourceLimit(ThreadResource);
25972617
image_view=AcquireAuthenticCacheView(image,exception);
2598-
for (n=0; n < max_iterations; n++)
2618+
for (n=0; n < (ssize_t) max_iterations; n++)
25992619
{
26002620
double
26012621
distortion;
@@ -2712,12 +2732,13 @@ MagickExport MagickBooleanType KmeansImage(Image *image,
27122732
image->colormap[j].alpha=gamma*QuantumRange*kmeans_pixels[0][j].alpha;
27132733
if (image->colorspace == CMYKColorspace)
27142734
image->colormap[j].black=gamma*QuantumRange*kmeans_pixels[0][j].black;
2735+
image->colormap[j].count=(MagickSizeType) kmeans_pixels[0][j].count;
27152736
distortion+=kmeans_pixels[0][j].distortion;
27162737
}
2717-
if (verbose != MagickFalse)
2718-
(void) FormatLocaleFile(stderr,"distortion[%.20g]: %*g %*g\n",(double) n,
2719-
GetMagickPrecision(),distortion,GetMagickPrecision(),
2720-
fabs(distortion-previous_tolerance));
2738+
if (image->debug != MagickFalse)
2739+
(void) LogMagickEvent(ImageEvent,GetMagickModule(),
2740+
"distortion[%.20g]: %*g %*g\n",(double) n,GetMagickPrecision(),
2741+
distortion,GetMagickPrecision(),fabs(distortion-previous_tolerance));
27212742
if (fabs(distortion-previous_tolerance) <= tolerance)
27222743
break;
27232744
previous_tolerance=distortion;
@@ -2733,6 +2754,25 @@ MagickExport MagickBooleanType KmeansImage(Image *image,
27332754
}
27342755
}
27352756
image_view=DestroyCacheView(image_view);
2757+
if (verbose != MagickFalse)
2758+
for (n=0; n < (ssize_t) image->colors; n++)
2759+
{
2760+
GetColorTuple(image->colormap+n,MagickTrue,tuple);
2761+
(void) FormatLocaleFile(stderr,"%s %.20g\n",tuple,(double)
2762+
image->colormap[n].count);
2763+
}
2764+
dominant_image=CloneImage(image,0,0,MagickTrue,exception);
2765+
if (dominant_image != (Image *) NULL)
2766+
{
2767+
/*
2768+
Note dominant color.
2769+
*/
2770+
qsort((void *) dominant_image->colormap,dominant_image->colors,
2771+
sizeof(*dominant_image->colormap),DominantColorCompare);
2772+
GetColorTuple(dominant_image->colormap,MagickTrue,tuple);
2773+
dominant_image=DestroyImage(dominant_image);
2774+
(void) SetImageProperty(image,"dominant-color",tuple,exception);
2775+
}
27362776
kmeans_pixels=DestroyKmeansTLS(kmeans_pixels);
27372777
if (image->progress_monitor != (MagickProgressMonitor) NULL)
27382778
(void) SetImageProgress(image,KmeansImageTag,(MagickOffsetType)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)