Remove unnecessary condition in acquiring image data
@@ -3812,10 +3812,6 @@ Image_composite_mathematics(int argc, VALUE *argv, VALUE self)
char compose_args[200];
rm_check_destroyed(self);
- if (argc > 0)
- {
- composite_image = rm_check_destroyed(rm_cur_image(argv[0]));
- }
switch (argc)
{
@@ -3836,6 +3832,7 @@ Image_composite_mathematics(int argc, VALUE *argv, VALUE self)
break;
}
+ composite_image = rm_check_destroyed(rm_cur_image(argv[0]));
(void) sprintf(compose_args, "%-.16g,%-.16g,%-.16g,%-.16g", NUM2DBL(argv[1]), NUM2DBL(argv[2]), NUM2DBL(argv[3]), NUM2DBL(argv[4]));
SetImageArtifact(composite_image,"compose:args", compose_args);
@@ -3893,11 +3890,6 @@ composite_tiled(int bang, int argc, VALUE *argv, VALUE self)
image = rm_check_destroyed(self);
}
- if (argc > 0)
- {
- comp_image = rm_check_destroyed(rm_cur_image(argv[0]));
- }
-
channels = extract_channels(&argc, argv);
switch (argc)
@@ -3914,6 +3906,8 @@ composite_tiled(int bang, int argc, VALUE *argv, VALUE self)
break;
}
+ comp_image = rm_check_destroyed(rm_cur_image(argv[0]));
+
if (!bang)
{
image = rm_clone_image(image);
@@ -11935,12 +11929,6 @@ Image_remap(int argc, VALUE *argv, VALUE self)
#endif
image = rm_check_frozen(self);
- if (argc > 0)
- {
- VALUE t = rm_cur_image(argv[0]);
- remap_image = rm_check_destroyed(t);
- RB_GC_GUARD(t);
- }
GetQuantizeInfo(&quantize_info);
@@ -11959,6 +11947,8 @@ Image_remap(int argc, VALUE *argv, VALUE self)
break;
}
+ remap_image = rm_check_destroyed(rm_cur_image(argv[0]));
+
#if defined(IMAGEMAGICK_7)
exception = AcquireExceptionInfo();
(void) RemapImage(&quantize_info, image, remap_image, exception);
