On Mon, Nov 23, 2009 at 10:15 PM, Luis Lavena <
luisl...@gmail.com> wrote:
>> ...and it failed to build, because there's no DestroyConstitute
>> function anymore. Must be some API change. :-/
> Definitely sounds like that :P
Seems it can be fixed by something like this:
diff --git a/ext/RMagick/extconf.rb b/ext/RMagick/extconf.rb
index 8d57d1c..cc449c8 100644
--- a/ext/RMagick/extconf.rb
+++ b/ext/RMagick/extconf.rb
@@ -221,7 +221,8 @@ have_func("snprintf", headers)
"SparseColorImage", # 6.3.6-?
"SyncAuthenticPixels", # 6.4.5-6
"TransparentPaintImage", # 6.3.7-10
- "TransparentPaintImageChroma" # 6.4.5-6
+ "TransparentPaintImageChroma", # 6.4.5-6
+ "ConstituteImage"
].each do |func|
have_func(func, headers)
end
diff --git a/ext/RMagick/rmimage.c b/ext/RMagick/rmimage.c
index 5a485fc..6796d3f 100644
--- a/ext/RMagick/rmimage.c
+++ b/ext/RMagick/rmimage.c
@@ -3052,8 +3052,12 @@ Image_constitute(VALUE class, VALUE width_arg,
VALUE height_arg
}
}
+#ifdef HAVE_CONSTITUTEIMAGE
GetExceptionInfo(&exception);
-
+ image = ConstituteImage(width, height, map, stg_type, (const void
*)pixels.v, &exception);
+ CHECK_EXCEPTION();
+ (void) DestroyExceptionInfo(&exception);
+#else
// This is based on ConstituteImage in IM 5.5.7
image = AcquireImage(NULL);
if (!image)
@@ -3071,8 +3075,8 @@ Image_constitute(VALUE class, VALUE width_arg,
VALUE height_arg
xfree(pixels.v);
rm_check_image_exception(image, DestroyOnError);
- (void) DestroyExceptionInfo(&exception);
DestroyConstitute();
+#endif
return rm_image_new(image);
}