ext/RMagick/rmimage.c in rmagick-4.1.0.rc1 vs ext/RMagick/rmimage.c in rmagick-4.1.0.rc2
- old
+ new
@@ -22,10 +22,14 @@
#define CHANGE_RESULT_CHANNEL_MASK(result) \
if (result != (Image *)NULL) \
SetPixelChannelMask(result, channel_mask);
+#ifndef magick_module
+ #define magick_module module
+#endif
+
/** Method that effects an image */
typedef Image *(effector_t)(const Image *, const double, const double, ExceptionInfo *);
/** Method that flips an image */
typedef Image *(flipper_t)(const Image *, ExceptionInfo *);
/** Method that magnifies an image */
@@ -3930,11 +3934,11 @@
{
for (x = 0; status == MagickTrue && x < (long) image->columns; x += columns)
{
#if defined(IMAGEMAGICK_7)
BEGIN_CHANNEL_MASK(image, channels);
- status = CompositeImage(image, comp_image, MagickTrue, operator, x, y, exception);
+ status = CompositeImage(image, comp_image, operator, MagickTrue, x, y, exception);
END_CHANNEL_MASK(image);
rm_check_exception(exception, image, bang ? RetainOnError: DestroyOnError);
#else
status = CompositeImageChannel(image, channels, operator, comp_image, x, y);
rm_check_image_exception(image, bang ? RetainOnError: DestroyOnError);
@@ -10925,10 +10929,11 @@
{
Image *image, *new_image;
MagickBooleanType dither = MagickFalse;
unsigned long levels = 4;
#if defined(IMAGEMAGICK_7)
+ DitherMethod dither_method;
ExceptionInfo *exception;
#endif
image = rm_check_destroyed(self);
switch (argc)
@@ -10947,11 +10952,12 @@
new_image = rm_clone_image(image);
#if defined(IMAGEMAGICK_7)
exception = AcquireExceptionInfo();
- (void) PosterizeImage(new_image, levels, dither, exception);
+ dither_method = dither ? RiemersmaDitherMethod : NoDitherMethod;
+ (void) PosterizeImage(new_image, levels, dither_method, exception);
rm_check_exception(exception, new_image, DestroyOnError);
(void) DestroyExceptionInfo(exception);
#else
(void) PosterizeImage(new_image, levels, dither);
rm_check_image_exception(new_image, DestroyOnError);
@@ -16111,19 +16117,19 @@
exception = AcquireExceptionInfo();
magick_info = GetMagickInfo(magic, exception);
CHECK_EXCEPTION();
DestroyExceptionInfo(exception);
- if (magick_info && magick_info->module)
+ if (magick_info && magick_info->magick_module)
{
// We have to compare the module names because some formats have
// more than one name. JPG and JPEG, for example.
exception = AcquireExceptionInfo();
magick_info2 = GetMagickInfo(info->magick, exception);
CHECK_EXCEPTION();
DestroyExceptionInfo(exception);
- if (magick_info2->module && strcmp(magick_info->module, magick_info2->module) != 0)
+ if (magick_info2->magick_module && strcmp(magick_info->magick_module, magick_info2->magick_module) != 0)
{
rb_raise(rb_eRuntimeError
, "filename prefix `%s' conflicts with output format `%s'"
, magick_info->name, info->magick);
}