unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14358: Option to use GraphicsMagick instead of ImageMagick
@ 2013-05-07  7:12 Glenn Morris
  2017-12-04  3:03 ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2013-05-07  7:12 UTC (permalink / raw)
  To: 14358

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 <wand/magick_wand.h>
+ #else
  #include <wand/MagickWand.h>
+ #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.  */






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#14358: Option to use GraphicsMagick instead of ImageMagick
  2013-05-07  7:12 bug#14358: Option to use GraphicsMagick instead of ImageMagick Glenn Morris
@ 2017-12-04  3:03 ` Glenn Morris
  2021-10-30 16:37   ` Stefan Kangas
  0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2017-12-04  3:03 UTC (permalink / raw)
  To: 14358


There's no interest in addressing this issue. Closing as wontfix.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#14358: Option to use GraphicsMagick instead of ImageMagick
  2017-12-04  3:03 ` Glenn Morris
@ 2021-10-30 16:37   ` Stefan Kangas
  2021-11-03  3:16     ` Richard Stallman
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Kangas @ 2021-10-30 16:37 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 14358

Glenn Morris <rgm@gnu.org> writes:

> 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:

Glenn Morris <rgm@gnu.org> writes:

> There's no interest in addressing this issue. Closing as wontfix.

Given that we are now no longer recommending ImageMagick, perhaps
GraphicsMagick support feels more relevant now than it used to?

From my point of view, GraphicsMagick has better performance, half as
many dependencies, and way fewer CVE's.  Like ImageMagick, it also gives
us "free" support for a ton of different image formats, and "free" new
ones in the future.

On the flip-side, I personally get by just fine with our built-in
support for JPEG, GIF, SVG, PNG and some others (this list will include
WEBP in Emacs 29.1).  So I have no idea what need our users have for
support for a wider range of image formats.

One final consideration is that GraphicsMagick support could be a step
towards making our ImageMagick support obsolete.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#14358: Option to use GraphicsMagick instead of ImageMagick
  2021-10-30 16:37   ` Stefan Kangas
@ 2021-11-03  3:16     ` Richard Stallman
  2021-11-03  3:54       ` Stefan Kangas
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2021-11-03  3:16 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: rgm, 14358

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  From my point of view, GraphicsMagick has better performance, half as
  many dependencies, and way fewer CVE's.  Like ImageMagick, it also gives
  us "free" support for a ton of different image formats, and "free" new
  ones in the future.

Could you explain the significance of the quotation marks?  I hope it
doesn't imply doubt about whether GraphicsMagick is free software.
What is the license of GraphicsMagick?

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#14358: Option to use GraphicsMagick instead of ImageMagick
  2021-11-03  3:16     ` Richard Stallman
@ 2021-11-03  3:54       ` Stefan Kangas
  2021-11-05  3:52         ` Richard Stallman
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Kangas @ 2021-11-03  3:54 UTC (permalink / raw)
  To: rms; +Cc: rgm, 14358

Richard Stallman <rms@gnu.org> writes:

>   From my point of view, GraphicsMagick has better performance, half as
>   many dependencies, and way fewer CVE's.  Like ImageMagick, it also gives
>   us "free" support for a ton of different image formats, and "free" new
>   ones in the future.
>
> Could you explain the significance of the quotation marks?

It was intended as a way of saying "we get it for free" (i.e. with no
effort) but realizing that at the end of the day we will still have to
work for it.

Sorry if my way of formulating this was unclear.

> I hope it doesn't imply doubt about whether GraphicsMagick is free
> software.  What is the license of GraphicsMagick?

There is no doubt that it is free software.  It uses the Expat license.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#14358: Option to use GraphicsMagick instead of ImageMagick
  2021-11-03  3:54       ` Stefan Kangas
@ 2021-11-05  3:52         ` Richard Stallman
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2021-11-05  3:52 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: rgm, 14358

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > Could you explain the significance of the quotation marks?

  > It was intended as a way of saying "we get it for free" (i.e. with no
  > effort) but realizing that at the end of the day we will still have to
  > work for it.

  > Sorry if my way of formulating this was unclear.

The meaning that I guessed was totally different.

That way of expressing a meaning is similar to
sarcasm: it states what you don't mean, not what you do mean.
In general, negative communication isn't clear, so I suggest
carefully avoiding.

If you had said, "as a bonus, we will get advantages X, Y and Z,"
it would have been fully clear.

The word "free" is a special pitfall.  I've taught myself _never_ to
use the word "free" except to refer to freedom.  If I mean "at no
cost", I say it without "free".  I am just as careful about this when
I describes someone else's views as when I state my own.

In a quotation, I replace "free" with "[gratis]"; that means "perse
said something that meant 'gratis'".  The square brackets are a
scholarly convention to state that one has emended a quotation.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-05  3:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07  7:12 bug#14358: Option to use GraphicsMagick instead of ImageMagick Glenn Morris
2017-12-04  3:03 ` Glenn Morris
2021-10-30 16:37   ` Stefan Kangas
2021-11-03  3:16     ` Richard Stallman
2021-11-03  3:54       ` Stefan Kangas
2021-11-05  3:52         ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).