_data=(void *) NULL;
_length=0;
_size=0;
- if ((x_ < 0) || (width_ < 0) || (y_ < 0) || (height_ < 0) ||
+ if ((x_ < 0) || (width_ == 0) || (y_ < 0) || (height_ == 0) ||
(x_ > image_.columns()) || (width_ + x_ > image_.columns()) ||
(y_ > image_.rows()) || (height_ + y_ > image_.rows()) ||
(map_.length() == 0))
_data=RelinquishMagickMemory(_data);
_length=0;
_size=0;
-}
\ No newline at end of file
+}
return(y);
}
-static inline MagickRealType ConvertHueToRGB(MagickRealType m1,
- MagickRealType m2,MagickRealType hue)
-{
- if (hue < 0.0)
- hue+=1.0;
- if (hue > 1.0)
- hue-=1.0;
- if ((6.0*hue) < 1.0)
- return(m1+6.0*(m2-m1)*hue);
- if ((2.0*hue) < 1.0)
- return(m2);
- if ((3.0*hue) < 2.0)
- return(m1+6.0*(m2-m1)*(2.0/3.0-hue));
- return(m1);
-}
-
static void HCLComposite(const MagickRealType hue,const MagickRealType chroma,
const MagickRealType luma,MagickRealType *red,MagickRealType *green,
MagickRealType *blue)
return(y);
}
-static inline double MagickMin(const double x,const double y)
-{
- if (x < y)
- return(x);
- return(y);
-}
-
static double FxChannelStatistics(FxInfo *fx_info,Image *image,
PixelChannel channel,const char *symbol,ExceptionInfo *exception)
{
return(p);
}
-static inline const unsigned char *ReadResourceBytes(const unsigned char *p,
- const ssize_t count,unsigned char *quantum)
-{
- register ssize_t
- i;
-
- for (i=0; i < count; i++)
- *quantum++=(*p++);
- return(p);
-}
-
static inline const unsigned char *ReadResourceLong(const unsigned char *p,
unsigned int *quantum)
{
% o image: the image.
%
*/
-
-static inline size_t MagickMax(const size_t x,const size_t y)
-{
- if (x > y)
- return(x);
- return(y);
-}
-
MagickExport QuantumInfo *AcquireQuantumInfo(const ImageInfo *image_info,
Image *image)
{
return(MagickFalse);
}
-static inline ssize_t MagickMax(const ssize_t x,const ssize_t y)
-{
- if (x > y)
- return(x);
- return(y);
-}
-
WandExport MagickBooleanType ImportImageCommand(ImageInfo *image_info,
int argc,char **argv,char **wand_unused(metadata),ExceptionInfo *exception)
{
# define wand_unused(x) x
#endif
-#if defined(__apple_build_version__)
-# define magick_alloc_size(x) __attribute__((__alloc_size__(x)))
-# define magick_alloc_sizes(x,y) __attribute__((__alloc_size__(x,y)))
-# define magick_cold_spot
-# define magick_hot_spot
-#else
-#if defined(__clang__) || (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
+#if (defined(__clang__) || (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))) && !defined(__apple_build_version__)
# define wand_alloc_size(x) __attribute__((__alloc_size__(x)))
# define wand_alloc_sizes(x,y) __attribute__((__alloc_size__(x,y)))
# define wand_cold_spot __attribute__((__cold__))
# define wand_cold_spot
# define wand_hot_spot
#endif
-#endif
#if defined(__cplusplus) || defined(c_plusplus)
}
status=SetImageProfile(image,"icc",profile,exception);
profile=DestroyStringInfo(profile);
if (status == MagickFalse)
- ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
- image->filename);
+ {
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+ return(FALSE);
+ }
}
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
status=SetImageProfile(image,"8bim",profile,exception);
profile=DestroyStringInfo(profile);
if (status == MagickFalse)
- ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
- image->filename);
+ {
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+ return(FALSE);
+ }
}
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
}
jpeg_info=DestroyImageInfo(jpeg_info);
}
- jpeg_set_quality(&jpeg_info,quality,MagickTrue);
+ jpeg_set_quality(&jpeg_info,quality,TRUE);
#if (JPEG_LIB_VERSION >= 70)
option=GetImageOption(image_info,"quality");
if (option != (const char *) NULL)
(geometry_info.rho+0.5));
jpeg_info.q_scale_factor[1]=jpeg_quality_scaling((int)
(geometry_info.sigma+0.5));
- jpeg_default_qtables(&jpeg_info,MagickTrue);
+ jpeg_default_qtables(&jpeg_info,TRUE);
}
}
#endif
table=DestroyQuantizationTable(table);
}
}
- jpeg_start_compress(&jpeg_info,MagickTrue);
+ jpeg_start_compress(&jpeg_info,TRUE);
if (image->debug != MagickFalse)
{
if (image->storage_class == PseudoClass)
% o exception: return any errors or warnings in this structure.
%
*/
-
-static inline ssize_t ConstrainPixel(Image *image,const ssize_t offset,
- const size_t extent,ExceptionInfo *exception)
-{
- if ((offset < 0) || (offset > (ssize_t) extent))
- {
- (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError,
- "InvalidPixel","`%s'",image->filename);
- return(0);
- }
- return(offset);
-}
-
static void PNMComment(Image *image,ExceptionInfo *exception)
{
int