modifyImage();
GetPPException;
- AcquireImageColormap(image(),entries_,&exceptionInfo);
+ (void) AcquireImageColormap(image(),entries_,&exceptionInfo);
ThrowPPException;
}
{
modifyImage();
GetPPException;
- SetImageBackgroundColor(image(),&exceptionInfo);
+ (void) SetImageBackgroundColor(image(),&exceptionInfo);
ThrowPPException;
}
void Magick::Image::syncPixels(void)
{
GetPPException;
- (*SyncAuthenticPixels)(image(),&exceptionInfo);
+ (void) (*SyncAuthenticPixels)(image(),&exceptionInfo);
ThrowPPException;
}
if (image_phash == (ChannelPerceptualHash *) NULL)
return(MagickFalse);
reconstruct_phash=GetImagePerceptualHash(reconstruct_image,exception);
- if (image_phash == (ChannelPerceptualHash *) NULL)
+ if (reconstruct_phash == (ChannelPerceptualHash *) NULL)
{
image_phash=(ChannelPerceptualHash *) RelinquishMagickMemory(image_phash);
return(MagickFalse);
}
if (status != Z_OK)
ThrowBinaryException(CoderError,"UnableToZipCompressImage",image->filename)
- else
- for (i=0; i < (ssize_t) compress_packets; i++)
- (void) WriteBlobByte(image,compress_pixels[i]);
+ for (i=0; i < (ssize_t) compress_packets; i++)
+ (void) WriteBlobByte(image,compress_pixels[i]);
compress_pixels=(unsigned char *) RelinquishMagickMemory(compress_pixels);
- return(status == Z_OK ? MagickTrue : MagickFalse);
+ return(MagickTrue);
}
#else
MagickExport MagickBooleanType ZLIBEncodeImage(Image *image,
{
offset-=length;
n++;
- length=scale*(draw_info->dash_pattern[n]+(n == 0 ? -0.5 : 0.5));
+ length=scale*(draw_info->dash_pattern[n]+0.5);
continue;
}
if (offset < length)
}
p=(const MimeInfo *) GetNextValueInLinkedList(mime_cache);
}
- if (p != (const MimeInfo *) NULL)
+ if (mime_info != (const MimeInfo *) NULL)
(void) InsertValueInLinkedList(mime_cache,0,
RemoveElementByValueFromLinkedList(mime_cache,p));
UnlockSemaphoreInfo(mime_semaphore);
rotate_view=AcquireAuthenticCacheView(rotate_image,exception);
switch (rotations)
{
- case 0:
- {
- /*
- Rotate 0 degrees.
- */
- break;
- }
case 1:
{
size_t
page.x=(ssize_t) (page.width-rotate_image->columns-page.x);
break;
}
+ default:
+ break;
}
rotate_view=DestroyCacheView(rotate_view);
image_view=DestroyCacheView(image_view);
/*
Dismiss button status changed.
*/
- dismiss_info.raised=cancel_info.raised == MagickFalse ?
+ dismiss_info.raised=dismiss_info.raised == MagickFalse ?
MagickTrue : MagickFalse;
XDrawBeveledButton(display,&windows->widget,&dismiss_info);
break;
length=2UL*(bytes_per_line+2UL)+2UL;
dib_data=(unsigned char *) AcquireQuantumMemory(length,
(image->rows+2UL)*sizeof(*dib_data));
- if (pixels == (unsigned char *) NULL)
+ if (dib_data == (unsigned char *) NULL)
{
pixels=(unsigned char *) RelinquishMagickMemory(pixels);
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
Dump colormap to file.
*/
dib_colormap=(unsigned char *) AcquireQuantumMemory((size_t)
- (1UL << dib_info.bits_per_pixel),4*sizeof(dib_colormap));
+ (1UL << dib_info.bits_per_pixel),4*sizeof(*dib_colormap));
if (dib_colormap == (unsigned char *) NULL)
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
q=dib_colormap;
r+=GetPixelChannels(image);
}
- SyncAuthenticPixels(image,exception);
+ (void) SyncAuthenticPixels(image,exception);
}
}
q=(unsigned char *) RelinquishMagickMemory(q);
Read DPX film header.
*/
offset+=ReadBlob(image,sizeof(dpx.film.id),(unsigned char *) dpx.film.id);
- if (*dpx.film.type != '\0')
+ if (*dpx.film.id != '\0')
(void) FormatImageProperty(image,"dpx:film.id","%.2s",dpx.film.id);
offset+=ReadBlob(image,sizeof(dpx.film.type),(unsigned char *)
dpx.film.type);
return(ReadBlobDouble(image));
}
-static void GetFITSPixelExtrema(Image *image,const int bits_per_pixel,
- double *minima,double *maxima)
+static MagickOffsetType GetFITSPixelExtrema(Image *image,
+ const int bits_per_pixel,double *minima,double *maxima)
{
double
pixel;
i;
offset=TellBlob(image);
+ if (offset == -1)
+ return(-1);
number_pixels=(MagickSizeType) image->columns*image->rows;
*minima=GetFITSPixel(image,bits_per_pixel);
*maxima=(*minima);
if (pixel > *maxima)
*maxima=pixel;
}
- (void) SeekBlob(image,offset,SEEK_SET);
+ return(SeekBlob(image,offset,SEEK_SET));
}
static inline double GetFITSPixelRange(const size_t depth)
if ((fits_info.min_data == 0.0) && (fits_info.max_data == 0.0))
{
if (fits_info.zero == 0.0)
- GetFITSPixelExtrema(image,fits_info.bits_per_pixel,
+ (void) GetFITSPixelExtrema(image,fits_info.bits_per_pixel,
&fits_info.min_data,&fits_info.max_data);
else
fits_info.max_data=GetFITSPixelRange((size_t)
Initialize default viewing parameters.
*/
contrast=1.0;
- contrast_valid=MagickFalse;
+ contrast_valid=MagickTrue;
color_twist.byy=1.0;
color_twist.byc1=0.0;
color_twist.byc2=0.0;
color_twist.dummy5_zero=0.0;
color_twist.dummy6_zero=0.0;
color_twist.dummy7_one=1.0;
- color_twist_valid=MagickFalse;
+ color_twist_valid=MagickTrue;
sharpen=0.0;
- sharpen_valid=MagickFalse;
+ sharpen_valid=MagickTrue;
aspect_ratio=(double) image->columns/image->rows;
- aspect_ratio_valid=MagickFalse;
+ aspect_ratio_valid=MagickTrue;
view_rect.left=(float) 0.1;
view_rect.width=aspect_ratio-0.2;
view_rect.top=(float) 0.1;
view_rect.height=(float) 0.8; /* 1.0-0.2 */
- view_rect_valid=MagickFalse;
+ view_rect_valid=MagickTrue;
affine.a11=1.0;
affine.a12=0.0;
affine.a13=0.0;
affine.a42=0.0;
affine.a43=0.0;
affine.a44=1.0;
- affine_valid=MagickFalse;
+ affine_valid=MagickTrue;
if (0)
{
/*
SetColorBalance(0.5,1.0,1.0,&color_twist);
color_twist_valid=MagickTrue;
}
- if (affine_valid)
+ if (affine_valid != MagickFalse)
{
fpx_status=FPX_SetImageAffineMatrix(flashpix,&affine);
if (fpx_status != FPX_OK)
ThrowWriterException(DelegateError,"UnableToSetAffineMatrix");
}
- if (aspect_ratio_valid)
+ if (aspect_ratio_valid != MagickFalse)
{
fpx_status=FPX_SetImageResultAspectRatio(flashpix,&aspect_ratio);
if (fpx_status != FPX_OK)
ThrowWriterException(DelegateError,"UnableToSetAspectRatio");
}
- if (color_twist_valid)
+ if (color_twist_valid != MagickFalse)
{
fpx_status=FPX_SetImageColorTwistMatrix(flashpix,&color_twist);
if (fpx_status != FPX_OK)
ThrowWriterException(DelegateError,"UnableToSetColorTwist");
}
- if (contrast_valid)
+ if (contrast_valid != MagickFalse)
{
fpx_status=FPX_SetImageContrastAdjustment(flashpix,&contrast);
if (fpx_status != FPX_OK)
ThrowWriterException(DelegateError,"UnableToSetContrast");
}
- if (sharpen_valid)
+ if (sharpen_valid != MagickFalse)
{
fpx_status=FPX_SetImageFilteringValue(flashpix,&sharpen);
if (fpx_status != FPX_OK)
ThrowWriterException(DelegateError,"UnableToSetFilteringValue");
}
- if (view_rect_valid)
+ if (view_rect_valid != MagickFalse)
{
fpx_status=FPX_SetImageROI(flashpix,&view_rect);
if (fpx_status != FPX_OK)
(void) ReadBlobLSBShort(image); /* height */
tile_length=ReadBlobLSBLong(image);
tile_offset=(int) ReadBlobLSBLong(image);
+ if (tile_offset == -1)
+ continue;
restore_offset=TellBlob(image);
offset=SeekBlob(image,(MagickOffsetType) tile_offset,SEEK_SET);
if (offset != (MagickOffsetType) tile_offset)
for (i=0; i < 10; i++)
magick[i]=(char) GetCharacter(jpeg_info);
magick[10]='\0';
+ length-=10;
if (length <= 10)
return(TRUE);
- length-=10;
if (LocaleCompare(magick,"Photoshop ") != 0)
{
/*
return NULL;
}
- mat_file = fdopen(AcquireUniqueFileResource(clone_info->filename),"w");
+ mat_file=0;
+ file = AcquireUniqueFileResource(clone_info->filename);
+ if (file != -1)
+ mat_file = fdopen(file,"w");
if(!mat_file)
{
RelinquishMagickMemory(CacheBlock);
*q++=ScaleQuantumToChar(GetPixelRed(tile_image,p));
*q++=ScaleQuantumToChar(GetPixelGreen(tile_image,p));
*q++=ScaleQuantumToChar(GetPixelBlue(tile_image,p));
- if (image->colorspace == CMYKColorspace)
+ if (tile_image->colorspace == CMYKColorspace)
*q++=ScaleQuantumToChar(GetPixelBlack(tile_image,p));
p+=GetPixelChannels(tile_image);
}
bits_per_pixel=1UL*ReadBlobByte(image);
number_colormaps=1UL*ReadBlobByte(image);
one=1;
- map_length=one << ReadBlobByte(image);
+ map_length=one << (unsigned char) ReadBlobByte(image);
if ((number_planes == 0) || (number_planes == 2) || (bits_per_pixel != 8) ||
(image->columns == 0))
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
clone_info->length=0;
/* Obtain temporary file */
- AcquireUniqueFilename(postscript_file);
+ (void) AcquireUniqueFilename(postscript_file);
ps_file=fopen_utf8(postscript_file,"wb");
if (ps_file == (FILE *) NULL)
goto FINISH;