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-22 -> 7.1.1-23
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored and MolotovCherry committed Dec 11, 2023
1 parent c16817d commit 570a239
Show file tree
Hide file tree
Showing 643 changed files with 156 additions and 148 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-22
IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.1-23
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 @@ -1694,7 +1694,7 @@ static Cache GetImagePixelCache(Image *image,const MagickBooleanType clone,
cpu_throttle = MagickResourceInfinity,
cycles = 0;

if (difftime(GetMagickTime(),image->timestamp) > (double) image->ttl)
if (IsImageTTLExpired(image) != MagickFalse)
{
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"TimeLimitExceeded","`%s'",image->filename);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3931,7 +3931,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res
case rGotoChk:
assert (pel->EleNdx >= 0);
i = pel->EleNdx-1; /* -1 because 'for' loop will increment. */
if (difftime(GetMagickTime(),img->timestamp) > (double) img->ttl) {
if (IsImageTTLExpired(img) != MagickFalse) {
i = pfx->usedElements-1; /* Do no more opcodes. */
(void) ThrowMagickException (pfx->exception, GetMagickModule(),
ResourceLimitFatalError, "TimeLimitExceeded", "`%s'", img->filename);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info,
Image
*image;

int
time_limit;

MagickStatusType
flags;

Expand Down Expand Up @@ -184,7 +187,9 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info,
image->channel_map=AcquirePixelChannelMap();
image->blob=CloneBlobInfo((BlobInfo *) NULL);
image->timestamp=GetMagickTime();
image->ttl=(time_t) GetMagickResourceLimit(TimeResource);
time_limit=(int) GetMagickResourceLimit(TimeResource);
if (time_limit > 0)
image->ttl=image->timestamp+time_limit;
image->debug=(GetLogEventMask() & (ImageEvent | TransformEvent | CoderEvent))
!= 0 ? MagickTrue : MagickFalse;
image->reference_count=1;
Expand Down Expand Up @@ -3223,19 +3228,19 @@ MagickExport MagickBooleanType SetImageMask(Image *image,const PixelMask type,
{
case ReadPixelMask:
{
image->channels=(ChannelType) (image->channels &
image->channels=(ChannelType) ((unsigned int) image->channels &
(unsigned int) ~ReadMaskChannel);
break;
}
case WritePixelMask:
{
image->channels=(ChannelType) (image->channels &
image->channels=(ChannelType) ((unsigned int) image->channels &
(unsigned int) ~WriteMaskChannel);
magick_fallthrough;
}
default:
{
image->channels=(ChannelType) (image->channels &
image->channels=(ChannelType) ((unsigned int) image->channels &
(unsigned int) ~CompositeMaskChannel);
break;
}
Expand Down Expand Up @@ -3383,19 +3388,19 @@ MagickExport MagickBooleanType SetImageRegionMask(Image *image,
{
case ReadPixelMask:
{
image->channels=(ChannelType) (image->channels &
image->channels=(ChannelType) ((unsigned int) image->channels &
(unsigned int) ~ReadMaskChannel);
break;
}
case WritePixelMask:
{
image->channels=(ChannelType) (image->channels &
image->channels=(ChannelType) ((unsigned int) image->channels &
(unsigned int) ~WriteMaskChannel);
break;
}
default:
{
image->channels=(ChannelType) (image->channels &
image->channels=(ChannelType) ((unsigned int) image->channels &
(unsigned int) ~CompositeMaskChannel);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ MagickExport MagickBooleanType SetImageProgress(const Image *image,
LockSemaphoreInfo(monitor_semaphore);
status=image->progress_monitor(message,offset,extent,image->client_data);
(void) FormatLocaleString(message,MagickPathExtent,"%g%%:%s:%s",
(100.0*offset*PerceptibleReciprocal(extent-1.0)),
(double) (100.0*offset*PerceptibleReciprocal(extent-1.0)),
tag == (const char *) NULL ? "null" : tag,image->filename);
(void) SetImageArtifact((Image *) image,"monitor:progress",message);
UnlockSemaphoreInfo(monitor_semaphore);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
% March 2000 %
% %
% %
% Copyright @ 2000 ImageMagick Studio LLC, a non-profit organization %
% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
Expand Down Expand Up @@ -1073,6 +1073,8 @@ static double RunOpenCLBenchmark(MagickBooleanType is_cpu)
CloneString(&imageInfo->size,"2048x1536");
CopyMagickString(imageInfo->filename,"xc:none",MagickPathExtent);
inputImage=ReadImage(imageInfo,exception);
if (inputImage == (Image *) NULL)
return(0.0);

InitAccelerateTimer(&timer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3354,16 +3354,16 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
{
WarnNoImageReturn("\"%%[%s]\"",property);
(void) FormatLocaleString(value,MagickPathExtent,"%.*g",
GetMagickPrecision(),PerceptibleReciprocal(image->resolution.x)*
image->columns);
GetMagickPrecision(),(double) PerceptibleReciprocal(
image->resolution.x)*image->columns);
break;
}
if (LocaleCompare("printsize.y",property) == 0)
{
WarnNoImageReturn("\"%%[%s]\"",property);
(void) FormatLocaleString(value,MagickPathExtent,"%.*g",
GetMagickPrecision(),PerceptibleReciprocal(image->resolution.y)*
image->rows);
GetMagickPrecision(),(double) PerceptibleReciprocal(
image->resolution.y)*image->rows);
break;
}
if (LocaleCompare("profiles",property) == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static ResourceInfo
MagickULLConstant(768), /* file limit */
MagickULLConstant(1), /* thread limit */
MagickULLConstant(0), /* throttle limit */
INT_MAX /* time limit */
MagickULLConstant(0), /* time limit */
};

static SemaphoreInfo
Expand Down Expand Up @@ -332,8 +332,7 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
if (((MagickSizeType) resource_info.time+(MagickSizeType) request) > (MagickSizeType) resource_info.time)
{
resource_info.time+=request;
if ((limit == MagickResourceInfinity) ||
(resource_info.time < (MagickOffsetType) limit))
if ((limit == 0) || (resource_info.time < (MagickOffsetType) limit))
status=MagickTrue;
else
resource_info.time-=request;
Expand Down Expand Up @@ -971,7 +970,7 @@ MagickExport MagickBooleanType ListMagickResourceInfo(FILE *file,
(void) FormatMagickSize(resource_info.disk_limit,MagickTrue,"B",
MagickFormatExtent,disk_limit);
(void) CopyMagickString(time_limit,"unlimited",MagickFormatExtent);
if (resource_info.time_limit != INT_MAX)
if (resource_info.time_limit != 0)
FormatTimeToLive(resource_info.time_limit,time_limit);
(void) FormatLocaleFile(file,"Resource limits:\n");
(void) FormatLocaleFile(file," Width: %s\n",width_limit);
Expand Down Expand Up @@ -1333,7 +1332,7 @@ MagickPrivate MagickBooleanType ResourceComponentGenesis(void)
limit,100.0));
limit=DestroyString(limit);
}
(void) SetMagickResourceLimit(TimeResource,INT_MAX);
(void) SetMagickResourceLimit(TimeResource,0);
limit=GetEnvironmentValue("MAGICK_TIME_LIMIT");
if (limit != (char *) NULL)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2129,26 +2129,28 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image,
channel_statistics[channel].minima=(double) p[i];
if ((double) p[i] > channel_statistics[channel].maxima)
channel_statistics[channel].maxima=(double) p[i];
channel_statistics[channel].sum+=(double) p[i];
channel_statistics[channel].sum_squared+=(double) p[i]*(double) p[i];
channel_statistics[channel].sum_cubed+=(double) p[i]*(double) p[i]*
(double) p[i];
channel_statistics[channel].sum_fourth_power+=(double) p[i]*(double)
p[i]*(double) p[i]*(double) p[i];
channel_statistics[channel].sum+=QuantumScale*p[i];
channel_statistics[channel].sum_squared+=QuantumScale*p[i]*
QuantumScale*p[i];
channel_statistics[channel].sum_cubed+=QuantumScale*p[i]*
QuantumScale*p[i]*QuantumScale*p[i];
channel_statistics[channel].sum_fourth_power+=QuantumScale*p[i]*
QuantumScale*p[i]*QuantumScale*p[i]*QuantumScale*p[i];
channel_statistics[channel].area++;
if ((double) p[i] < channel_statistics[CompositePixelChannel].minima)
channel_statistics[CompositePixelChannel].minima=(double) p[i];
channel_statistics[CompositePixelChannel].minima=p[i];
if ((double) p[i] > channel_statistics[CompositePixelChannel].maxima)
channel_statistics[CompositePixelChannel].maxima=(double) p[i];
channel_statistics[CompositePixelChannel].maxima=p[i];
histogram[(ssize_t) GetPixelChannels(image)*ScaleQuantumToMap(
ClampToQuantum((double) p[i]))+i]++;
channel_statistics[CompositePixelChannel].sum+=(double) p[i];
channel_statistics[CompositePixelChannel].sum_squared+=(double)
p[i]*(double) p[i];
channel_statistics[CompositePixelChannel].sum_cubed+=(double)
p[i]*(double) p[i]*(double) p[i];
channel_statistics[CompositePixelChannel].sum_fourth_power+=(double)
p[i]*(double) p[i]*(double) p[i]*(double) p[i];
ClampToQuantum(p[i]))+i]++;
channel_statistics[CompositePixelChannel].sum+=QuantumScale*p[i];
channel_statistics[CompositePixelChannel].sum_squared+=QuantumScale*
p[i]*QuantumScale*p[i];
channel_statistics[CompositePixelChannel].sum_cubed+=QuantumScale*
p[i]*QuantumScale*p[i]*QuantumScale*p[i];
channel_statistics[CompositePixelChannel].sum_fourth_power+=
QuantumScale*p[i]*QuantumScale*p[i]*QuantumScale*p[i]*
QuantumScale*p[i];
channel_statistics[CompositePixelChannel].area++;
}
p+=GetPixelChannels(image);
Expand Down Expand Up @@ -2223,6 +2225,16 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image,
channel_statistics[i].mean)*(standard_deviation*standard_deviation*
standard_deviation*standard_deviation)-3.0;
}
for (i=0; i <= (ssize_t) MaxPixelChannels; i++)
{
channel_statistics[i].mean*=QuantumRange;
channel_statistics[i].variance*=QuantumRange;
channel_statistics[i].standard_deviation*=QuantumRange;
channel_statistics[i].sum*=QuantumRange;
channel_statistics[i].sum_squared*=QuantumRange;
channel_statistics[i].sum_cubed*=QuantumRange;
channel_statistics[i].sum_fourth_power*=QuantumRange;
}
median_info=AcquireVirtualMemory(image->columns,image->rows*sizeof(*median));
if (median_info == (MemoryInfo *) NULL)
(void) ThrowMagickException(exception,GetMagickModule(),
Expand Down Expand Up @@ -2985,8 +2997,8 @@ MagickExport Image *StatisticImage(const Image *image,const StatisticType type,
minimum=(double) pixels[i];
if ((double) pixels[i] > maximum)
maximum=(double) pixels[i];
sum+=(double) pixels[i];
sum_squared+=(double) pixels[i]*(double) pixels[i];
sum+=QuantumScale*pixels[i];
sum_squared+=QuantumScale*pixels[i]*QuantumScale*pixels[i];
pixels+=GetPixelChannels(image);
}
pixels+=GetPixelChannels(image)*image->columns;
Expand All @@ -3012,7 +3024,7 @@ MagickExport Image *StatisticImage(const Image *image,const StatisticType type,
case MeanStatistic:
default:
{
pixel=ClampToQuantum(sum/area);
pixel=QuantumRange*ClampToQuantum(sum/area);
break;
}
case MedianStatistic:
Expand All @@ -3037,12 +3049,13 @@ MagickExport Image *StatisticImage(const Image *image,const StatisticType type,
}
case RootMeanSquareStatistic:
{
pixel=ClampToQuantum(sqrt(sum_squared/area));
pixel=QuantumRange*ClampToQuantum(sqrt(sum_squared/area));
break;
}
case StandardDeviationStatistic:
{
pixel=ClampToQuantum(sqrt(sum_squared/area-(sum/area*sum/area)));
pixel=QuantumRange*ClampToQuantum(sqrt(sum_squared/area-
(sum/area*sum/area)));
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ extern MagickExport time_t
extern MagickPrivate void
SetMagickDatePrecision(const unsigned long);

static inline MagickBooleanType IsImageTTLExpired(const Image* image)
{
if (image->ttl == (time_t) 0)
return(MagickFalse);
return(image->ttl < GetMagickTime() ? MagickTrue : MagickFalse);
}

#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
Expand Down
Loading

0 comments on commit 570a239

Please sign in to comment.