From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#14358: Option to use GraphicsMagick instead of ImageMagick Date: Tue, 07 May 2013 03:12:36 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1367910798 13390 80.91.229.3 (7 May 2013 07:13:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 May 2013 07:13:18 +0000 (UTC) To: 14358@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 07 09:13:16 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UZc5G-0006ZE-Hc for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 May 2013 09:13:10 +0200 Original-Received: from localhost ([::1]:60187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZc5G-0007uc-2L for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 May 2013 03:13:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZc59-0007q4-6y for bug-gnu-emacs@gnu.org; Tue, 07 May 2013 03:13:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZc57-0006bd-BA for bug-gnu-emacs@gnu.org; Tue, 07 May 2013 03:13:02 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZc57-0006bZ-6w for bug-gnu-emacs@gnu.org; Tue, 07 May 2013 03:13:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UZc66-0007Li-3v for bug-gnu-emacs@gnu.org; Tue, 07 May 2013 03:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 May 2013 07:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14358 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136791082428195 (code B ref -1); Tue, 07 May 2013 07:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 May 2013 07:13:44 +0000 Original-Received: from localhost ([127.0.0.1]:60519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZc5n-0007Kh-66 for submit@debbugs.gnu.org; Tue, 07 May 2013 03:13:44 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:46722) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZc5j-0007KU-5C for submit@debbugs.gnu.org; Tue, 07 May 2013 03:13:41 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1UZc4i-0005Zs-SZ; Tue, 07 May 2013 03:12:36 -0400 X-Spook: Firefly Al Jazeera quarter weapons of mass destruction X-Ran: W11N!5zVVv_3CTIyX~yDK`WyXg[3162[ List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:74041 Archived-At: Package: emacs Version: 24.3 Severity: wishlist Is it possible/desirable for Emacs to be able to use GraphicsMagick instead of ImageMagick? I'm assuming they provide the same functionality, but I know nothing about it. I has a rough'n'ready go at the trivial stuff (see below), but then gave up with these errors: image.c: In function 'imagemagick_error': image.c:7607: warning: cast to pointer from integer of different size image.c: In function 'imagemagick_load_image': image.c:7633: error: 'PixelIterator' undeclared (first use in this function) image.c:7633: error: (Each undeclared identifier is reported only once image.c:7633: error: for each function it appears in.) image.c:7633: error: 'iterator' undeclared (first use in this function) image.c:7635: error: 'MagickPixelPacket' undeclared (first use in this function) image.c:7635: error: expected ';' before 'pixel' image.c:7658: warning: implicit declaration of function 'MagickPingImageBlob' image.c:7895: warning: implicit declaration of function 'NewPixelIterator' image.c:7896: error: expected expression before ')' token image.c:7910: warning: implicit declaration of function 'PixelGetNextIteratorRow' image.c:7915: warning: implicit declaration of function 'PixelGetMagickColor' image.c:7915: error: 'pixel' undeclared (first use in this function) image.c:7923: warning: implicit declaration of function 'DestroyPixelIterator' image.c: In function 'Fimagemagick_types': image.c:8023: warning: implicit declaration of function 'GetMagickList' image.c:8023: warning: assignment makes pointer from integer without a cast make: *** [image.o] Error 1 === modified file 'configure.ac' *** configure.ac 2013-05-07 01:12:22 +0000 --- configure.ac 2013-05-07 01:43:25 +0000 *************** *** 183,188 **** --- 183,189 ---- OPTION_DEFAULT_ON([rsvg],[don't compile with SVG image support]) OPTION_DEFAULT_ON([xml2],[don't compile with XML parsing support]) OPTION_DEFAULT_ON([imagemagick],[don't compile with ImageMagick image support]) + OPTION_DEFAULT_OFF([graphicsmagick],[use GraphicsMagick rather than ImageMagick]) OPTION_DEFAULT_ON([xft],[don't use XFT for anti aliased fonts]) OPTION_DEFAULT_ON([libotf],[don't use libotf for OpenType font support]) *************** *** 1931,1955 **** fi HAVE_IMAGEMAGICK=no if test "${HAVE_X11}" = "yes"; then ! if test "${with_imagemagick}" != "no"; then ## 6.2.8 is the earliest version known to work, but earlier versions ## might work - let us know if you find one. ## 6.0.7 does not work. See bug#7955. ## 6.8.2 makes Emacs crash; see Bug#13867. IMAGEMAGICK_MODULE="Wand >= 6.2.8 Wand != 6.8.2" ! PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :) ! AC_SUBST(IMAGEMAGICK_CFLAGS) ! AC_SUBST(IMAGEMAGICK_LIBS) if test $HAVE_IMAGEMAGICK = yes; then AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.]) ! CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS" ! LIBS="$IMAGEMAGICK_LIBS $LIBS" AC_CHECK_FUNCS(MagickExportImagePixels MagickMergeImageLayers) fi fi ! fi HAVE_GTK=no --- 1932,1976 ---- fi HAVE_IMAGEMAGICK=no + HAVE_GRAPHICSMAGICK=no + if test "${HAVE_X11}" = "yes"; then ! ! if test "${with_imagemagick}" != "no" && \ ! test "${with_graphicsmagick}" != "yes"; then ## 6.2.8 is the earliest version known to work, but earlier versions ## might work - let us know if you find one. ## 6.0.7 does not work. See bug#7955. ## 6.8.2 makes Emacs crash; see Bug#13867. IMAGEMAGICK_MODULE="Wand >= 6.2.8 Wand != 6.8.2" ! PKG_CHECK_MODULES(MAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :) ! AC_SUBST(MAGICK_CFLAGS) ! AC_SUBST(MAGICK_LIBS) if test $HAVE_IMAGEMAGICK = yes; then AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.]) ! CFLAGS="$CFLAGS $MAGICK_CFLAGS" ! LIBS="$MAGICK_LIBS $LIBS" AC_CHECK_FUNCS(MagickExportImagePixels MagickMergeImageLayers) fi fi ! ! if test "${with_graphicsmagick}" != "no" && \ ! test "${with_imagemagick}" != "no" && \ ! test $HAVE_IMAGEMAGICK != yes; then ! GRAPHICSMAGICK_MODULE="GraphicsMagickWand" ! PKG_CHECK_MODULES(MAGICK, $GRAPHICSMAGICK_MODULE, HAVE_GRAPHICSMAGICK=yes, :) ! AC_SUBST(MAGICK_CFLAGS) ! AC_SUBST(MAGICK_LIBS) ! ! if test $HAVE_GRAPHICSMAGICK = yes; then ! AC_DEFINE(HAVE_GRAPHICSMAGICK, 1, [Define to 1 if using GraphicsMagick.]) ! CFLAGS="$CFLAGS $MAGICK_CFLAGS" ! LIBS="$MAGICK_LIBS $LIBS" ! fi ! fi ! ! fi dnl HAVE_X11 HAVE_GTK=no *************** *** 4385,4390 **** --- 4406,4412 ---- echo " Does Emacs use -lpng? ${HAVE_PNG}" echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}" echo " Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK}" + echo " Does Emacs use graphicsmagick? ${HAVE_GRAPHICSMAGICK}" echo " Does Emacs use -lgpm? ${HAVE_GPM}" echo " Does Emacs use -ldbus? ${HAVE_DBUS}" === modified file 'src/Makefile.in' *** src/Makefile.in 2013-05-07 01:12:22 +0000 --- src/Makefile.in 2013-05-07 01:37:58 +0000 *************** *** 226,233 **** RSVG_LIBS= @RSVG_LIBS@ RSVG_CFLAGS= @RSVG_CFLAGS@ ! IMAGEMAGICK_LIBS= @IMAGEMAGICK_LIBS@ ! IMAGEMAGICK_CFLAGS= @IMAGEMAGICK_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ --- 226,233 ---- RSVG_LIBS= @RSVG_LIBS@ RSVG_CFLAGS= @RSVG_CFLAGS@ ! MAGICK_LIBS= @MAGICK_LIBS@ ! MAGICK_CFLAGS= @MAGICK_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ *************** *** 320,326 **** ALL_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \ -I$(lib) -I$(srcdir)/../lib \ $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ ! $(GNUSTEP_CFLAGS) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(IMAGEMAGICK_CFLAGS) \ $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) $(XRANDR_CFLAGS) $(XINERAMA_CFLAGS) \ $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \ $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \ --- 320,326 ---- ALL_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \ -I$(lib) -I$(srcdir)/../lib \ $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ ! $(GNUSTEP_CFLAGS) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(MAGICK_CFLAGS) \ $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) $(XRANDR_CFLAGS) $(XINERAMA_CFLAGS) \ $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \ $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \ *************** *** 397,403 **** ## Construct full set of libraries to be linked. LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ $(LIBX_OTHER) $(LIBSOUND) \ ! $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) \ $(LIB_EACCESS) $(LIB_FDATASYNC) $(LIB_TIMER_TIME) $(DBUS_LIBS) \ $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) \ $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ --- 397,403 ---- ## Construct full set of libraries to be linked. LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ $(LIBX_OTHER) $(LIBSOUND) \ ! $(RSVG_LIBS) $(MAGICK_LIBS) $(LIB_CLOCK_GETTIME) \ $(LIB_EACCESS) $(LIB_FDATASYNC) $(LIB_TIMER_TIME) $(DBUS_LIBS) \ $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) \ $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ === modified file 'src/image.c' *** src/image.c 2013-04-07 04:41:19 +0000 --- src/image.c 2013-05-07 01:50:27 +0000 *************** *** 7473,7479 **** /*********************************************************************** ImageMagick ***********************************************************************/ ! #if defined (HAVE_IMAGEMAGICK) static Lisp_Object Qimagemagick; --- 7473,7485 ---- /*********************************************************************** ImageMagick ***********************************************************************/ ! #if defined (HAVE_IMAGEMAGICK) || defined (HAVE_GRAPHICSMAGICK) ! ! #ifdef HAVE_GRAPHICSMAGICK ! #define MagickWandGenesis() InitializeMagick(NULL) ! #define MagickWandTerminus DestroyMagick ! #define MagickBooleanType int ! #endif static Lisp_Object Qimagemagick; *************** *** 7571,7577 **** --- 7577,7587 ---- /* The GIF library also defines DrawRectangle, but its never used in Emacs. Therefore rename the function so it doesn't collide with ImageMagick. */ #define DrawRectangle DrawRectangleGif + #ifdef HAVE_GRAPHICSMAGICK + #include + #else #include + #endif /* ImageMagick 6.5.3 through 6.6.5 hid PixelGetMagickColor for some reason. Emacs seems to work fine with the hidden version, so unhide it. */