Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Update ImageMagick from 7.1.1-12 -> 7.1.1-13
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored and MolotovCherry committed Jul 16, 2023
1 parent 6f03518 commit 5b11c46
Show file tree
Hide file tree
Showing 643 changed files with 460 additions and 270 deletions.
2 changes: 1 addition & 1 deletion Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ OPENCL_INCLUDE_PATH := $(OPENCL_PATH)/qualcomm/include

LTDL_LIB_PATH := $(LOCAL_PATH)/libltdl-2.4.6

IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.1-12
IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.1-13
IMAGE_MAGICK := $(LOCAL_PATH)/$(IMAGE_MAGICK_BASEDIR)

JPEG_LIB_PATH := $(LOCAL_PATH)/libjpeg-turbo-2.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ MagickExport MagickBooleanType AnnotateImage(Image *image,
height=CastDoubleToUnsigned(metrics.ascent-metrics.descent+0.5);
if (height == 0)
height=draw_info->pointsize;
height+=(size_t) floor(draw_info->interline_spacing+0.5);
height=CastDoubleToUnsigned(floor((double) height+
draw_info->interline_spacing+0.5));
switch (annotate->gravity)
{
case UndefinedGravity:
Expand Down Expand Up @@ -805,7 +806,10 @@ MagickExport MagickBooleanType GetMultilineTypeMetrics(Image *image,
*/
textlist=StringToStrings(draw_info->text,&count);
if (textlist == (char **) NULL)
return(MagickFalse);
{
annotate_info=DestroyDrawInfo(annotate_info);
return(MagickFalse);
}
annotate_info->render=MagickFalse;
annotate_info->direction=UndefinedDirection;
(void) memset(metrics,0,sizeof(*metrics));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4852,6 +4852,61 @@ MagickPrivate void ResetPixelCacheEpoch(void)
% %
% %
% %
% R e s h a p e P i x e l C a c h e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ReshapePixelCache() reshapes an existing pixel cache.
%
% The format of the ReshapePixelCache() method is:
%
% MagickBooleanType ReshapePixelCache(Image *image,const size_t columns,
% const size_t rows,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o image: the image.
%
% o columns: the number of columns in the reshaped pixel cache.
%
% o rows: number of rows in the reshaped pixel cache.
%
% o exception: return any errors or warnings in this structure.
%
*/
MagickExport MagickBooleanType ReshapePixelCache(Image *image,
const size_t columns,const size_t rows,ExceptionInfo *exception)
{
CacheInfo
*cache_info;

MagickSizeType
extent;

assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (IsEventLogging() != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(image->cache != (void *) NULL);
extent=(MagickSizeType) columns*rows;
if (extent > ((MagickSizeType) image->columns*image->rows))
ThrowBinaryException(ImageError,"WidthOrHeightExceedsLimit",
image->filename);
image->columns=columns;
image->rows=rows;
cache_info=(CacheInfo *) image->cache;
cache_info->columns=columns;
cache_info->rows=rows;
return(SyncImagePixelCache(image,exception));
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
+ S e t P i x e l C a c h e M e t h o d s %
% %
% %
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ extern MagickExport MagickBooleanType
const ssize_t,const ssize_t,PixelInfo *,ExceptionInfo *),
PersistPixelCache(Image *,const char *,const MagickBooleanType,
MagickOffsetType *,ExceptionInfo *),
ReshapePixelCache(Image *,const size_t,const size_t,ExceptionInfo *),
SyncAuthenticPixels(Image *,ExceptionInfo *) magick_hot_spot;

extern MagickExport MagickSizeType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ MagickExport Image *SeparateImages(const Image *image,ExceptionInfo *exception)
{
PixelChannel channel = GetPixelChannelChannel(image,i);
PixelTrait traits = GetPixelChannelTraits(image,channel);
if (traits == UndefinedPixelTrait)
if ((traits == UndefinedPixelTrait) || ((traits & UpdatePixelTrait) == 0))
continue;
separate_image=SeparateImage(image,(ChannelType) (1UL << channel),
exception);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,48 +414,47 @@ static inline void ConvertOklabToRGB(const double L,const double a,
const double b,double *red,double *green,double *blue)
{
double
B,
G,
l,
l_,
m,
m_,
s,
s_;

l_ = L+0.3963377774*a+0.2158037573*b;
m_ = L-0.1055613458*a-0.0638541728*b;
s_ = L-0.0894841775*a-1.2914855480*b;

l = l_*l_*l_;
m = m_*m_*m_;
s = s_*s_*s_;

*red = 4.0767416621*l-3.3077115913*m+0.2309699292*s;
*green = -1.2684380046*l+2.6097574011*m-0.3413193965*s;
*blue = -0.0041960863*l-0.7034186147*m+1.7076147010*s;
R,
s;

l=L+0.3963377774*(a-0.5)+0.2158037573*(b-0.5);
m=L-0.1055613458*(a-0.5)-0.0638541728*(b-0.5);
s=L-0.0894841775*(a-0.5)-1.2914855480*(b-0.5);
l*=l*l;
m*=m*m;
s*=s*s;
R=4.0767416621*l-3.3077115913*m+0.2309699292*s;
G=(-1.2684380046)*l+2.6097574011*m-0.3413193965*s;
B=(-0.0041960863)*l-0.7034186147*m+1.7076147010*s;
*red=EncodePixelGamma(QuantumRange*R);
*green=EncodePixelGamma(QuantumRange*G);
*blue=EncodePixelGamma(QuantumRange*B);
}

static void ConvertRGBToOklab(const double red,const double green,
const double blue,double *L,double *a,double *b)
{
double
B,
G,
l,
l_,
m,
m_,
s,
s_;

l = 0.4122214708*red+0.5363325363*green+0.0514459929*blue;
m = 0.2119034982*red+0.6806995451*green+0.1073969566*blue;
s = 0.0883024619*red+0.2817188376*green+0.6299787005*blue;

l_ = cbrt(l);
m_ = cbrt(m);
s_ = cbrt(s);

*L = 0.2104542553*l_+0.7936177850*m_-0.0040720468*s_;
*a = 1.9779984951*l_-2.4285922050*m_+0.4505937099*s_;
*b = 0.0259040371*l_+0.7827717662*m_-0.8086757660*s_;
R,
s;

R=QuantumScale*DecodePixelGamma(red);
G=QuantumScale*DecodePixelGamma(green);
B=QuantumScale*DecodePixelGamma(blue);
l=cbrt(0.4122214708*R+0.5363325363*G+0.0514459929*B);
m=cbrt(0.2119034982*R+0.6806995451*G+0.1073969566*B);
s=cbrt(0.0883024619*R+0.2817188376*G+0.6299787005*B);
*L=0.2104542553*l+0.7936177850*m-0.0040720468*s;
*a=1.9779984951*l-2.4285922050*m+0.4505937099*s+0.5;
*b=0.0259040371*l+0.7827717662*m-0.8086757660*s+0.5;
}

static inline void ConvertOklchToRGB(const double L,const double C,
Expand All @@ -465,9 +464,8 @@ static inline void ConvertOklchToRGB(const double L,const double C,
a,
b;

a = C*cos(2*MagickPI*h);
b = C*sin(2*MagickPI*h);

a=C*cos(2.0*MagickPI*h);
b=C*sin(2.0*MagickPI*h);
ConvertOklabToRGB(L,a,b,red,green,blue);
}

Expand All @@ -479,9 +477,8 @@ static void ConvertRGBToOklch(const double red,const double green,
b;

ConvertRGBToOklab(red,green,blue,L,&a,&b);

*C = sqrt(a*a+b*b);
*h = 0.5+0.5*atan2(-b,-a)/MagickPI;
*C=sqrt(a*a+b*b);
*h=0.5+0.5*atan2(-b,-a)/MagickPI;
}

static void ConvertRGBToYDbDr(const double red,const double green,
Expand Down Expand Up @@ -609,12 +606,12 @@ static MagickBooleanType sRGBTransformImage(Image *image,
PixelInfo
pixel;

ssize_t
x;

Quantum
*magick_restrict q;

ssize_t
x;

if (status == MagickFalse)
continue;
q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ static MagickBooleanType CompositeOverImage(Image *image,
}
pixels=p;
if (x_offset < 0)
p-=x_offset*(ssize_t) GetPixelChannels(source_image);
p-=CastDoubleToLong((double) x_offset*GetPixelChannels(source_image));
}
q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
Expand Down Expand Up @@ -2322,7 +2322,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
}
pixels=p;
if (x_offset < 0)
p-=x_offset*(ssize_t) GetPixelChannels(source_image);
p-=CastDoubleToLong((double) x_offset*GetPixelChannels(source_image));
}
q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3534,7 +3534,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res
if (ImgNum == 0) {
Image * pimg = pfx->Images[0];
if (pel->ImgAttrQual == aNull) {
if (pel->ChannelQual < 0) {
if ((int) pel->ChannelQual < 0) {
if (pel->ChannelQual == NO_CHAN_QUAL || pel->ChannelQual == THIS_CHANNEL) {
if (pfx->ImgNum==0) {
regA = QuantumScale * p[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset];
Expand Down Expand Up @@ -3580,7 +3580,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res
/* We have non-zero ImgNum. */
if (pel->ImgAttrQual == aNull) {
const Quantum * pv;
if ((int)pel->ChannelQual < 0) {
if ((int) pel->ChannelQual < 0) {
if (pel->ChannelQual == HUE_CHANNEL || pel->ChannelQual == SAT_CHANNEL ||
pel->ChannelQual == LIGHT_CHANNEL)
{
Expand Down Expand Up @@ -3614,7 +3614,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res
If called from %[fx:...], ChannelQual will be CompositePixelChannel.
*/
Image * pimg = pfx->Images[0];
if (pel->ChannelQual < 0) {
if ((int) pel->ChannelQual < 0) {
if (pel->ChannelQual == NO_CHAN_QUAL || pel->ChannelQual == THIS_CHANNEL) {

if (pfx->ImgNum==0) {
Expand Down Expand Up @@ -3670,7 +3670,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res
fy = regC;
}

if ((int)pel->ChannelQual < 0) {
if ((int) pel->ChannelQual < 0) {
if (pel->ChannelQual == HUE_CHANNEL || pel->ChannelQual == SAT_CHANNEL
|| pel->ChannelQual == LIGHT_CHANNEL) {
regA = GetHslFlt (pfx, ImgNum, fx, fy, pel->ChannelQual);
Expand Down Expand Up @@ -3713,7 +3713,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res
break;
}

if ((int)pel->ChannelQual < 0) {
if ((int) pel->ChannelQual < 0) {
if (pel->ChannelQual == HUE_CHANNEL || pel->ChannelQual == SAT_CHANNEL ||
pel->ChannelQual == LIGHT_CHANNEL) {
regA = GetHslInt (pfx, ImgNum, imgx, imgy, pel->ChannelQual);
Expand Down Expand Up @@ -3746,7 +3746,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res
fx = regA;
fy = regB;
}
if ((int)pel->ChannelQual < 0) {
if ((int) pel->ChannelQual < 0) {
if (pel->ChannelQual == HUE_CHANNEL || pel->ChannelQual == SAT_CHANNEL ||
pel->ChannelQual == LIGHT_CHANNEL) {
regA = GetHslFlt (pfx, ImgNum, fx, fy, pel->ChannelQual);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1286,9 +1286,9 @@ MagickPrivate void ConvertRGBToHWB(const double red,const double green,
%
% ConvertRGBToLab() transforms a (red, green, blue) to a (L, a, b) triple.
%
% The format of the ConvertRGBToLCHab method is:
% The format of the ConvertRGBToLab method is:
%
% void ConvertRGBToLCHab(const double red,const double green,
% void ConvertRGBToLab(const double red,const double green,
% const double blue,double *L,double *a,double *b)
%
% A description of each parameter follows:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "MagickCore/magick-config.h"

#if MAGICKCORE_HAVE_UINTPTR_T
#if defined(MAGICKCORE_HAVE_UINTPTR_T)
# include <stdint.h>
#endif

Expand Down Expand Up @@ -142,7 +142,7 @@ typedef unsigned __int64 MagickSizeType;
#define MagickSizeFormat "I64u"
#endif

#if MAGICKCORE_HAVE_UINTPTR_T || defined(uintptr_t)
#if defined(MAGICKCORE_HAVE_UINTPTR_T) || defined(uintptr_t)
typedef uintptr_t MagickAddressType;
#else
/* Hope for the best, I guess. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1624,9 +1624,6 @@ MagickExport void MagickCoreTerminus(void)
}
MonitorComponentTerminus();
RegistryComponentTerminus();
#if defined(MAGICKCORE_X11_DELEGATE)
XComponentTerminus();
#endif
#if defined(MAGICKCORE_XML_DELEGATE)
xmlCleanupParser();
#endif
Expand All @@ -1648,6 +1645,9 @@ MagickExport void MagickCoreTerminus(void)
#endif
#if defined(MAGICKCORE_MODULES_SUPPORT)
ModuleComponentTerminus();
#endif
#if defined(MAGICKCORE_X11_DELEGATE)
XComponentTerminus();
#endif
CoderComponentTerminus();
ResourceComponentTerminus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ extern "C" {
# define magick_unreferenced(x) /* nothing */
#endif

#if !defined(__clang__) && (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
#if !defined(__clang__) && (defined(__GNUC__) && (__GNUC__) > 4)
# define magick_alloc_size(x) __attribute__((__alloc_size__(x)))
# define magick_alloc_sizes(x,y) __attribute__((__alloc_size__(x,y)))
# define magick_fallthrough __attribute__((fallthrough))
Expand All @@ -117,7 +117,7 @@ extern "C" {
# define magick_fallthrough /* nothing */
#endif

#if defined(__clang__) || (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__) > 4)
# define magick_cold_spot __attribute__((__cold__))
# define magick_hot_spot __attribute__((__hot__))
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ extern MagickPrivate MagickBooleanType
NTReportEvent(const char *,const MagickBooleanType);

extern MagickExport MagickBooleanType
NTLongPathsEnabled();
NTLongPathsEnabled(void);

extern MagickPrivate struct dirent
*NTReadDirectory(DIR *);
Expand Down
Loading

0 comments on commit 5b11c46

Please sign in to comment.