From: Andreas Eversberg Date: Sat, 20 Jun 2015 04:37:06 +0000 (+0200) Subject: Fix ImageMagick support, disable GraphicsMagick support X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=colorize.git;a=commitdiff_plain;h=9b04385e7a99576413e64927e32ddcd9025795c0 Fix ImageMagick support, disable GraphicsMagick support --- diff --git a/configure.ac b/configure.ac index ec3960d..1ebefcc 100644 --- a/configure.ac +++ b/configure.ac @@ -47,20 +47,21 @@ AM_CONDITIONAL(ENABLE_GUI, test x"$enable_gui" = x"yes") somethingmagick=no -AC_ARG_ENABLE(graphicsmagick, - [AS_HELP_STRING( - [--disable-graphicsmagick], - [Disable building graphicsmagick] - )], - [enable_graphicsmagick=$enableval], [enable_graphicsmagick="yes"]) -if test x"$enable_graphicsmagick" = x"yes" -then - PKG_CHECK_MODULES(GRAPHICSMAGICK, GraphicsMagick >= 1.3.16, , enable_graphicsmagick=no) -fi -if test x"$enable_graphicsmagick" = x"yes" -then - somethingmagick=yes -fi +# disabled due to problems with api compatibilty with imagemagick +#AC_ARG_ENABLE(graphicsmagick, +# [AS_HELP_STRING( +# [--disable-graphicsmagick], +# [Disable building graphicsmagick] +# )], +# [enable_graphicsmagick=$enableval], [enable_graphicsmagick="yes"]) +#if test x"$enable_graphicsmagick" = x"yes" +#then +# PKG_CHECK_MODULES(GRAPHICSMAGICK, GraphicsMagick >= 1.3.16, , enable_graphicsmagick=no) +#fi +#if test x"$enable_graphicsmagick" = x"yes" +#then +# somethingmagick=yes +#fi AC_ARG_ENABLE(imagemagick, [AS_HELP_STRING( @@ -101,26 +102,26 @@ AC_OUTPUT( AS_IF([test "x$have_windows" == xno],[AC_MSG_NOTICE( Compiling for Unix )],[AC_MSG_NOTICE([ Compiling for Windows ])]) -AS_IF([test "x$enable_gui" == xyes],[AC_MSG_NOTICE( Compiled with GTK (GUI) )],[AC_MSG_NOTICE([ +AS_IF([test "x$enable_gui" == xyes],[AC_MSG_NOTICE( Compiling with GTK (GUI) )],[AC_MSG_NOTICE([ -** Not compiled with GTK (GUI) support ** +** Not compiling with GTK (GUI) support ** In order to use GUI, GTK+ 2.0 or higher must be installed. ])]) -AS_IF([test "x$somethingmagick" == xyes],[AC_MSG_NOTICE( Compiled with ImageMagick or GraphicsMagick )],[AC_MSG_NOTICE([ +AS_IF([test "x$somethingmagick" == xyes],[AC_MSG_NOTICE( Compiling with ImageMagick )],[AC_MSG_NOTICE([ -** Not compiled with GraphicsMagick and ImageMagick support ** +** Not compiling with ImageMagick support ** Only PPM image files can be loaded and saved. ])]) -AS_IF([test "x$enable_opencv" == xyes],[AC_MSG_NOTICE( Compiled with OpenCV )],[AC_MSG_NOTICE([ +AS_IF([test "x$enable_opencv" == xyes],[AC_MSG_NOTICE( Compiling with OpenCV )],[AC_MSG_NOTICE([ -** Not compiled with OpenCV support ** +** Not compiling with OpenCV support ** It will not be possible to calculate motion flow vectors to improve colorization of moving objects. ])]) -AS_IF([test "x$with_debug_algo" == xyes],[AC_MSG_NOTICE( Compiled with debugging )],[]) +AS_IF([test "x$with_debug_algo" == xyes],[AC_MSG_NOTICE( Compiling with debugging )],[]) diff --git a/src/img.c b/src/img.c index a596c64..b2daa9a 100755 --- a/src/img.c +++ b/src/img.c @@ -16,8 +16,8 @@ unsigned short *load_img(int *width, int *height, const char *filename, int inde ExceptionInfo exception; unsigned short *img = NULL; -// MagickCoreGenesis(NULL,MagickFalse); - InitializeMagick(NULL); + MagickCoreGenesis(NULL, MagickFalse); +// InitializeMagick(NULL); imageinfo = CloneImageInfo(0); GetExceptionInfo(&exception); @@ -38,8 +38,8 @@ unsigned short *load_img(int *width, int *height, const char *filename, int inde goto exit; } -// ExportImagePixels(image, 0, 0, *width, *height, "RGB", ShortPixel, darrayGetPr(darray), NULL); - DispatchImage(image, 0, 0, *width, *height, "RGB", ShortPixel, img, NULL); + ExportImagePixels(image, 0, 0, *width, *height, "RGB", ShortPixel, img, NULL); +// DispatchImage(image, 0, 0, *width, *height, "RGB", ShortPixel, img, NULL); exit: if (image) @@ -48,8 +48,8 @@ exit: if (imageinfo) DestroyImageInfo(imageinfo); -// MagickCoreTerminus(); - DestroyMagick(); + MagickCoreTerminus(); +// DestroyMagick(); return img; } @@ -62,8 +62,8 @@ int save_img(unsigned short *img, int width, int height, int alpha, const char * ImageInfo *imageinfo = NULL; ExceptionInfo exception; -// MagickCoreGenesis(NULL,MagickFalse); - InitializeMagick(NULL); + MagickCoreGenesis(NULL, MagickFalse); +// InitializeMagick(NULL); imageinfo = CloneImageInfo(0); GetExceptionInfo(&exception); @@ -93,8 +93,8 @@ exit: if (imageinfo) DestroyImageInfo(imageinfo); -// MagickCoreTerminus(); - DestroyMagick(); + MagickCoreTerminus(); +// DestroyMagick(); return rc; }