Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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.2-3
IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.2-4
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 @@ -592,18 +592,17 @@ void Magick::Options::strokeDashArray(const double *strokeDashArray_)
{
size_t
x;
// Count elements in dash array
for (x=0; strokeDashArray_[x]; x++) ;
// Allocate elements

for (x=0; fabs(strokeDashArray_[x]) >= MagickEpsilon; x++) ;
_drawInfo->dash_pattern=static_cast<double*>(AcquireMagickMemory((x+1)*
sizeof(double)));
if (!_drawInfo->dash_pattern)
throwExceptionExplicit(MagickCore::ResourceLimitError,
"Unable to allocate dash-pattern memory");
else
{
// Copy elements
memcpy(_drawInfo->dash_pattern,strokeDashArray_,(x+1)*sizeof(double));
(void) memset(_drawInfo->dash_pattern,0,(size_t) (x+1)*sizeof(double));
memcpy(_drawInfo->dash_pattern,strokeDashArray_,x*sizeof(double));
_drawInfo->dash_pattern[x]=0.0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,9 @@ MagickExport Image *CombineImages(const Image *image,
MagickOffsetType
progress;

size_t
number_channels;

ssize_t
y;

Expand Down Expand Up @@ -539,26 +542,33 @@ MagickExport Image *CombineImages(const Image *image,
(void) SetImageColorspace(combine_image,RGBColorspace,exception);
else
(void) SetImageColorspace(combine_image,sRGBColorspace,exception);
number_channels=GetImageListLength(image);
switch (combine_image->colorspace)
{
case UndefinedColorspace:
case sRGBColorspace:
{
if (GetImageListLength(image) > 3)
if (number_channels > 3)
combine_image->alpha_trait=BlendPixelTrait;
if (number_channels > 4)
SetPixelMetaChannels(combine_image,number_channels-4,exception);
break;
}
case LinearGRAYColorspace:
case GRAYColorspace:
{
if (GetImageListLength(image) > 1)
if (number_channels > 1)
combine_image->alpha_trait=BlendPixelTrait;
if (number_channels > 2)
SetPixelMetaChannels(combine_image,number_channels-2,exception);
break;
}
case CMYKColorspace:
{
if (GetImageListLength(image) > 4)
if (number_channels > 4)
combine_image->alpha_trait=BlendPixelTrait;
if (number_channels > 5)
SetPixelMetaChannels(combine_image,number_channels-5,exception);
break;
}
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1966,8 +1966,10 @@ MagickExport Image *DistortImage(const Image *image, DistortMethod method,
geometry.width = (size_t) ceil((coeff[0]-coeff[1])*
(coeff[5]-coeff[4])*0.5);
/* correct scaling factors relative to new size */
coeff[6]=(coeff[5]-coeff[4]) * (double) geometry.width; /* changed width */
coeff[7]=(coeff[0]-coeff[1]) * (double) geometry.height; /* should be about 1.0 */
coeff[6]=(coeff[5]-coeff[4]) * MagickSafeReciprocal(
(double) geometry.width); /* changed width */
coeff[7]=(coeff[0]-coeff[1]) * MagickSafeReciprocal(
(double) geometry.height); /* should be about 1.0 */
break;
}
case Cylinder2PlaneDistortion:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,15 @@ MagickExport DrawInfo *CloneDrawInfo(const ImageInfo *image_info,
x;

for (x=0; fabs(draw_info->dash_pattern[x]) >= MagickEpsilon; x++) ;
clone_info->dash_pattern=(double *) AcquireQuantumMemory((size_t) (2*x+2),
clone_info->dash_pattern=(double *) AcquireQuantumMemory((size_t) (x+1),
sizeof(*clone_info->dash_pattern));
if (clone_info->dash_pattern == (double *) NULL)
ThrowFatalException(ResourceLimitFatalError,
"UnableToAllocateDashPattern");
(void) memset(clone_info->dash_pattern,0,(size_t) (2*x+2)*
(void) memset(clone_info->dash_pattern,0,(size_t) (x+1)*
sizeof(*clone_info->dash_pattern));
(void) memcpy(clone_info->dash_pattern,draw_info->dash_pattern,(size_t)
(x+1)*sizeof(*clone_info->dash_pattern));
x*sizeof(*clone_info->dash_pattern));
}
clone_info->gradient=draw_info->gradient;
if (draw_info->gradient.stops != (StopInfo *) NULL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ static int MagicInfoCompare(const void *x,const void *y)
#endif

MagickExport const MagicInfo **GetMagicInfoList(const char *pattern,
size_t *number_aliases,ExceptionInfo *magick_unused(exception))
size_t *number_aliases,ExceptionInfo *exception)
{
const MagicInfo
**aliases;
Expand All @@ -489,7 +489,7 @@ MagickExport const MagicInfo **GetMagicInfoList(const char *pattern,
if (IsEventLogging() != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
*number_aliases=0;
if (IsMagicCacheInstantiated() == MagickFalse)
if (IsMagicListInstantiated(exception) == MagickFalse)
return((const MagicInfo **) NULL);
aliases=(const MagicInfo **) AcquireQuantumMemory((size_t)
GetNumberOfElementsInLinkedList(magic_list)+1UL,sizeof(*aliases));
Expand Down Expand Up @@ -569,7 +569,7 @@ static int MagicCompare(const void *x,const void *y)
#endif

MagickExport char **GetMagicList(const char *pattern,size_t *number_aliases,
ExceptionInfo *magick_unused(exception))
ExceptionInfo *exception)
{
char
**aliases;
Expand All @@ -586,7 +586,7 @@ MagickExport char **GetMagicList(const char *pattern,size_t *number_aliases,
if (IsEventLogging() != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
*number_aliases=0;
if (IsMagicCacheInstantiated() == MagickFalse)
if (IsMagicListInstantiated(exception) == MagickFalse)
return((char **) NULL);
aliases=(char **) AcquireQuantumMemory((size_t)
GetNumberOfElementsInLinkedList(magic_list)+1UL,sizeof(*aliases));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ typedef void *ModuleHandle;
Define declarations.
*/
#if defined(MAGICKCORE_LTDL_DELEGATE)
# define FilterGlobExpression "*.la"
# define ModuleGlobExpression "*.la"
#else
# if defined(_DEBUG)
# define FilterGlobExpression "FILTER_DB_*.dll"
# define ModuleGlobExpression "IM_MOD_DB_*.dll"
# else
# define FilterGlobExpression "FILTER_RL_*.dll"
# define ModuleGlobExpression "IM_MOD_RL_*.dll"
# endif
#endif
Expand Down Expand Up @@ -454,7 +457,10 @@ MagickExport char **GetModuleList(const char *pattern,
while ((MagickReadDirectory(directory,buffer,&entry) == 0) &&
(entry != (struct dirent *) NULL))
{
status=GlobExpression(entry->d_name,ModuleGlobExpression,MagickFalse);
if (type == MagickImageFilterModule)
status=GlobExpression(entry->d_name,FilterGlobExpression,MagickFalse);
else
status=GlobExpression(entry->d_name,ModuleGlobExpression,MagickFalse);
if (status == MagickFalse)
continue;
if (GlobExpression(entry->d_name,pattern,MagickFalse) == MagickFalse)
Expand All @@ -479,6 +485,11 @@ MagickExport char **GetModuleList(const char *pattern,
(void) CopyMagickString(modules[i],modules[i]+10,MagickPathExtent);
modules[i][strlen(modules[i])-1]='\0';
}
else if (LocaleNCompare("FILTER_",modules[i],7) == 0)
{
(void) CopyMagickString(modules[i],modules[i]+10,MagickPathExtent);
modules[i][strlen(modules[i])-1]='\0';
}
i++;
}
buffer=(struct dirent *) RelinquishMagickMemory(buffer);
Expand Down Expand Up @@ -1525,7 +1536,11 @@ static void TagToFilterModuleName(const char *tag,char *name)
if (IsEventLogging() != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",tag);
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
(void) FormatLocaleString(name,MagickPathExtent,"FILTER_%s_.dll",tag);
#if defined(_DEBUG)
(void) FormatLocaleString(name,MagickPathExtent,"FILTER_DB_%s_.dll",tag);
#else
(void) FormatLocaleString(name,MagickPathExtent,"FILTER_RL_%s_.dll",tag);
#endif
#elif !defined(MAGICKCORE_LTDL_DELEGATE)
(void) FormatLocaleString(name,MagickPathExtent,"%s.dll",tag);
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1993,7 +1993,6 @@ MagickPrivate MagickBooleanType NTReportEvent(const char *event,
*/
MagickPrivate unsigned char *NTResourceToBlob(const char *id)
{

#ifndef MAGICKCORE_LIBRARY_NAME
char
path[MagickPathExtent];
Expand Down
Loading
Loading