GetPixelInfo(image,&target[1]);
p=GetCacheViewVirtualPixels(image_view,(ssize_t) image->columns-1,0,1,1,
exception);
- if (p == (const Quantum *) NULL)
+ if (p != (const Quantum *) NULL)
GetPixelInfoPixel(image,p,&target[1]);
GetPixelInfo(image,&target[2]);
p=GetCacheViewVirtualPixels(image_view,0,(ssize_t) image->rows-1,1,1,
exception);
- if (p == (const Quantum *) NULL)
+ if (p != (const Quantum *) NULL)
GetPixelInfoPixel(image,p,&target[2]);
status=MagickTrue;
GetPixelInfo(image,&zero);
status;
file=fileno(image->blob->file_info.file);
- if (file == -1)
+ if ((file == -1) || (offset < 0))
return(MagickFalse);
status=posix_fallocate(file,offset,extent-offset);
if (status != 0)
clone_nexus[id],exception);
if (pixels == (Quantum *) NULL)
continue;
- if (clone_nexus[id]->metacontent != (void *) NULL)
+ if ((clone_nexus[id]->metacontent != (void *) NULL) &&
+ (cache_nexus[id]->metacontent != (void *) NULL))
(void) memcpy(clone_nexus[id]->metacontent,
cache_nexus[id]->metacontent,length*
sizeof(cache_nexus[id]->metacontent));
if ((traits & UpdatePixelTrait) != 0)
channels++;
}
- return(channels);
+ return(channels == 0 ? 1 : channels);
}
static MagickBooleanType GetFuzzDistortion(const Image *image,
result->ai_protocol);
if (client_socket == -1)
{
- (void) close(client_socket);
(void) ThrowMagickException(exception,GetMagickModule(),CacheError,
"DistributedPixelCache","'%s'",hostname);
return(-1);
status=connect(client_socket,result->ai_addr,result->ai_addrlen);
if (status == -1)
{
+ (void) close(client_socket);
(void) ThrowMagickException(exception,GetMagickModule(),CacheError,
"DistributedPixelCache","'%s'",hostname);
return(-1);
(void) GetOneCacheViewVirtualPixelInfo(image_view,x,y,&target,
exception);
+ GetPixelInfo(image,&pixel);
for (y=0; y < (ssize_t) image->rows; y++)
{
register Quantum
(void) CopyMagickString(factor,"impulse",MaxTextExtent);
break;
}
- case 4:
+ case 5:
{
(void) CopyMagickString(factor,"laplacian",MaxTextExtent);
break;
}
- case 5:
+ case 6:
{
(void) CopyMagickString(factor,"Poisson",MaxTextExtent);
break;
(IfMagickFalse(IsGrayColorspace(black_color->colorspace)) ||
IfMagickFalse(IsGrayColorspace(white_color->colorspace))))
(void) SetImageColorspace(image,sRGBColorspace,exception);
- status=MagickFalse;
+ status=MagickTrue;
if( IfMagickFalse(invert) )
{
if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
}
if (fabs(pixel-p[center+i]) > MagickEpsilon)
changes[id]++;
- gamma=(double) kernel->height*kernel->width/count;
+ gamma=1.0;
+ if (count != 0)
+ gamma=(double) kernel->height*kernel->width/count;
SetPixelChannel(morphology_image,channel,ClampToQuantum(gamma*
pixel),q);
continue;
pixel->black=0.0;
pixel->alpha=(double) OpaqueAlpha;
pixel->index=0.0;
+ pixel->count=0;
+ pixel->fuzz=0.0;
if (image == (const Image *) NULL)
return;
pixel->storage_class=image->storage_class;
*/
{
char
- pattern[MaxTextExtent];
+ pattern[2*MaxTextExtent];
const char
*key,
p++; /* advance p to just inside the opening brace */
depth=1;
if ( *p == ']' ) {
- (void) ThrowMagickException(exception,GetMagickModule(),
- OptionWarning,"UnknownImageProperty","\"%%[]\"");
+ (void) ThrowMagickException(exception,GetMagickModule(),OptionWarning,
+ "UnknownImageProperty","\"%%[]\"");
break;
}
for (len=0; len<(MaxTextExtent-1L) && (*p != '\0');)
/*
Create a reduced color image.
*/
- if ((cube_info->quantize_info->dither_method != NoDitherMethod) &&
- (cube_info->quantize_info->dither_method != NoDitherMethod))
+ if (cube_info->quantize_info->dither_method != NoDitherMethod)
(void) DitherImage(image,cube_info,exception);
else
{
*/
length=strlen(entities[i]);
entity=strchr(xml,';');
- if ((length-1L) >= (size_t) (entity-xml))
+ if ((entity != (char *) NULL) &&
+ ((length-1L) >= (size_t) (entity-xml)))
{
offset=(ssize_t) (xml-p);
extent=(size_t) (offset+length+strlen(entity));
Image *composite_image,CompositeOptions *composite_options,
ExceptionInfo *exception)
{
- ChannelType
- channel_mask;
-
MagickStatusType
status;
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",(*image)->filename);
assert(exception != (ExceptionInfo *) NULL);
status=MagickTrue;
- channel_mask=SetImageChannelMask(composite_image,composite_options->channel);
if (composite_image != (Image *) NULL)
{
+ ChannelType
+ channel_mask;
+
+ channel_mask=SetImageChannelMask(composite_image,
+ composite_options->channel);
assert(composite_image->signature == MagickSignature);
switch (composite_options->compose)
{
composite_options->compose,MagickTrue,geometry.x,geometry.y,
exception);
}
+ (void) SetPixelChannelMask(composite_image,channel_mask);
}
- (void) SetPixelChannelMask(composite_image,channel_mask);
return(status != 0 ? MagickTrue : MagickFalse);
}
{
input=fopen_utf8(argv[i],"rb");
if (input == (FILE *) NULL)
- ThrowFileException(exception,FileOpenError,"UnableToOpenFile",argv[i]);
+ {
+ ThrowFileException(exception,FileOpenError,"UnableToOpenFile",argv[i]);
+ continue;
+ }
for (c=fgetc(input); c != EOF; c=fgetc(input))
(void) fputc((char) c,output);
(void) fclose(input);
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
assert(packet != (PixelInfo *) NULL);
packet->alpha=(double) ClampToQuantum(wand->pixel.alpha);
+ packet->alpha_trait=wand->pixel.alpha_trait;
if (wand->pixel.colorspace == CMYKColorspace)
{
packet->red=(double) ClampToQuantum(QuantumRange-
default:
{
orient_y=270;
+ break;
}
}
- (void) FormatLocaleString(header,MaxTextExtent,"rorient: %03ld,%03ld",
+ (void) FormatLocaleString(header,sizeof(header),"rorient: %03ld,%03ld",
(long) orient_x,(long) orient_y);
count=WriteCALSRecord(image,header);
- (void) FormatLocaleString(header,MaxTextExtent,"rpelcnt: %06lu,%06lu",
+ (void) FormatLocaleString(header,sizeof(header),"rpelcnt: %06lu,%06lu",
(unsigned long) image->columns,(unsigned long) image->rows);
count=WriteCALSRecord(image,header);
density=200;
(void) ParseGeometry(image_info->density,&geometry_info);
density=(size_t) floor(geometry_info.rho+0.5);
}
- (void) FormatLocaleString(header,MaxTextExtent,"rdensty: %04lu",
+ (void) FormatLocaleString(header,sizeof(header),"rdensty: %04lu",
(unsigned long) density);
count=WriteCALSRecord(image,header);
count=WriteCALSRecord(image,"notes: NONE");
p=option;
for (i=0; sscanf(p,"%f",¶meters.tcp_rates[i]) == 1; i++)
{
- if (i > 100)
+ if (i >= 100)
break;
while ((*p != '\0') && (*p != ','))
p++;
label=GetImageProperty(image,"label",exception);
draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
draw_info->text=ConstantString(label);
+ metrics.width=0;
status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
if ((image->columns == 0) && (image->rows == 0))
{
count=ReadBlob(image,4,(unsigned char *) type);
if ((count == 0) || (LocaleNCompare(type,"8BIM",4) != 0))
{
- if (DiscardBlobBytes(image,size-(ssize_t) quantum-8) == MagickFalse)
+ if (DiscardBlobBytes(image,(MagickSizeType) size-quantum-8) == MagickFalse)
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
}
else
rounded_layer_info_size=layer_info_size;
(void) SetPSDSize(&psd_info,image,rounded_layer_info_size);
- if (next_image->alpha_trait == BlendPixelTrait)
+ if (base_image->alpha_trait == BlendPixelTrait)
(void) WriteBlobMSBShort(image,-(unsigned short) layer_count);
else
(void) WriteBlobMSBShort(image,(unsigned short) layer_count);
layer_count=1;
compression=base_image->compression;
- next_image=base_image;
- while (next_image != NULL)
+ for (next_image=base_image; next_image != NULL; )
{
next_image->compression=NoCompression;
(void) WriteBlobMSBLong(image,(unsigned int) next_image->page.y);
if (status == MagickFalse)
break;
}
- (void) close(unique_file);
+ if (unique_file != -1)
+ (void) close(unique_file);
(void) RelinquishUniqueFileResource(read_info->filename);
read_info=DestroyImageInfo(read_info);
(void) CloseBlob(pwp_image);
y;
ssize_t
+ i,
ldblk;
unsigned int
*BImgBuff,
SampleBuffer[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
- unsigned int
- i;
-
x=0;
y=0;
ldblk=(ssize_t) ((bpp*image->columns+7)/8);