Skip to content

Commit

Permalink
Corrected stroke-opacity setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Mar 31, 2019
1 parent 1736fce commit 3b6ba12
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
4 changes: 2 additions & 2 deletions magick/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2872,7 +2872,7 @@ static MagickBooleanType RenderMVGContent(Image *image,
graphic_context[n]->fill_opacity;
else
graphic_context[n]->fill.opacity=ClampToQuantum(QuantumRange*
(1.0-opacity));
opacity);
break;
}
if (LocaleCompare("fill-rule",keyword) == 0)
Expand Down Expand Up @@ -3658,7 +3658,7 @@ static MagickBooleanType RenderMVGContent(Image *image,
graphic_context[n]->stroke_opacity;
else
graphic_context[n]->stroke.opacity=ClampToQuantum(QuantumRange*
(1.0-opacity));
opacity);
break;
}
if (LocaleCompare("stroke-width",keyword) == 0)
Expand Down
26 changes: 21 additions & 5 deletions magick/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,21 @@ static MagickBooleanType Classify(Image *image,short **extrema,
const MagickRealType weighting_exponent,const MagickBooleanType verbose)
{
#define SegmentImageTag "Segment/Image"
#define ThrowClassifyException(severity,tag,label) \
{\
for (cluster=head; cluster != (Cluster *) NULL; cluster=next_cluster) \
{ \
next_cluster=cluster->next; \
cluster=(Cluster *) RelinquishMagickMemory(cluster); \
} \
if (squares != (double *) NULL) \
{ \
squares-=255; \
free_squares=squares; \
free_squares=(double *) RelinquishMagickMemory(free_squares); \
} \
ThrowBinaryException(severity,tag,label); \
}

CacheView
*image_view;
Expand Down Expand Up @@ -291,6 +306,7 @@ static MagickBooleanType Classify(Image *image,short **extrema,
*/
cluster=(Cluster *) NULL;
head=(Cluster *) NULL;
squares=(double *) NULL;
(void) memset(&red,0,sizeof(red));
(void) memset(&green,0,sizeof(green));
(void) memset(&blue,0,sizeof(blue));
Expand Down Expand Up @@ -318,7 +334,7 @@ static MagickBooleanType Classify(Image *image,short **extrema,
head=cluster;
}
if (cluster == (Cluster *) NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
ThrowClassifyException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
/*
Initialize a new class.
Expand All @@ -338,7 +354,7 @@ static MagickBooleanType Classify(Image *image,short **extrema,
*/
cluster=(Cluster *) AcquireMagickMemory(sizeof(*cluster));
if (cluster == (Cluster *) NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
ThrowClassifyException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
/*
Initialize a new class.
Expand Down Expand Up @@ -499,13 +515,13 @@ static MagickBooleanType Classify(Image *image,short **extrema,
(void) FormatLocaleFile(stdout,"\n");
}
if (number_clusters > 256)
ThrowBinaryException(ImageError,"TooManyClusters",image->filename);
ThrowClassifyException(ImageError,"TooManyClusters",image->filename);
/*
Speed up distance calculations.
*/
squares=(MagickRealType *) AcquireQuantumMemory(513UL,sizeof(*squares));
if (squares == (MagickRealType *) NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
ThrowClassifyException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
squares+=255;
for (i=(-255); i <= 255; i++)
Expand All @@ -514,7 +530,7 @@ static MagickBooleanType Classify(Image *image,short **extrema,
Allocate image colormap.
*/
if (AcquireImageColormap(image,number_clusters) == MagickFalse)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
ThrowClassifyException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
i=0;
for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
Expand Down

0 comments on commit 3b6ba12

Please sign in to comment.