Blob Blame History Raw
commit 4001478a343b9631ade6be4192b2b12e1b8508b9
Author: Andreas Mair <amair.sob@googlemail.com>
Date:   Sat May 5 12:49:11 2012 +0200

    Add support for building with GraphicsMagick instead of ImageMagick. (Patch by Ville Skyttä)

diff --git a/Makefile b/Makefile
index bcf316c..5efa340 100644
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,8 @@
 # Debugging on/off 
 #SKINENIGMA_DEBUG = 1
 
-# If you have installed ImageMagick and want to use
-# images in event's and recording's details.
+# If you have installed ImageMagick and want to use images in events'
+# and recordings' details.  Set to GRAPHICS to use GraphicsMagick.
 #HAVE_IMAGEMAGICK = 1
 
 # If you are using the epgsearch plugin and want to see the number of
@@ -129,8 +129,13 @@ OBJS = $(PLUGIN).o enigma.o config.o logo.o tools.o status.o texteffects.o setup
 
 ifdef HAVE_IMAGEMAGICK
 OBJS += bitmap.o
+ifneq ($(HAVE_IMAGEMAGICK), GRAPHICS)
 LIBS += -lMagick++
 INCLUDES += -I/usr/include/ImageMagick -I/usr/local/include/ImageMagick
+else
+LIBS += $(shell pkg-config --libs GraphicsMagick++)
+INCLUDES += $(shell pkg-config --cflags GraphicsMagick++)
+endif
 endif
 
 ifneq ($(shell which freetype-config),)
diff --git a/README b/README
index c4de521..10526bd 100644
--- a/README
+++ b/README
@@ -46,8 +46,8 @@ This turns usage of logos in the main menu completely off. This might
 also improve the performance of the menus. EXPERIMENTAL!!!
 
 HAVE_IMAGEMAGICK = 1
-If you have installed ImageMagick and want to use images in event's
-and recording's details.
+If you have installed ImageMagick and want to use images in events'
+and recordings' details.  Set to GRAPHICS to use GraphicsMagick.
 
 SKINENIGMA_DISABLE_SIGNALINFO = 1
 Do not include code to show signal strength and signal-to-noise ratio.
diff --git a/bitmap.c b/bitmap.c
index 536c700..ff3e7aa 100644
--- a/bitmap.c
+++ b/bitmap.c
@@ -15,6 +15,11 @@ using namespace Magick;
 #include <vector>
 
 #include <vdr/themes.h>
+
+void cOSDImageBitmap::Init(void)
+{
+  InitializeMagick(NULL);
+}
  
 cOSDImageBitmap::cOSDImageBitmap()
 {}
diff --git a/bitmap.h b/bitmap.h
index 507d7f7..63644cb 100644
--- a/bitmap.h
+++ b/bitmap.h
@@ -18,6 +18,7 @@ public:
   cOSDImageBitmap();
   ~cOSDImageBitmap();
   bool DrawImage(const char *fileNameP, int x, int y, int w, int h, int colors, cBitmap *bmp);
+  static void Init(void);
 
 private:
   bool DrawMagick(const char *Filename, int x, int y, int height, int width, int colors, cBitmap *bmp);
diff --git a/logo.c b/logo.c
index 470c5b1..3eb2a24 100644
--- a/logo.c
+++ b/logo.c
@@ -18,6 +18,7 @@ cEnigmaLogoCache::cEnigmaLogoCache(unsigned int cacheSizeP) :cacheSizeM(cacheSiz
 {
 #ifdef HAVE_IMAGEMAGICK
   bmpImage = new cBitmap(8, 8, 1);
+  cOSDImageBitmap::Init();
 #endif
 }