Skip to content

Commit

Permalink
Switch to GraphicsMagick. Can be reverted by configoption in makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaV0lt committed Jan 5, 2021
1 parent ce0be9e commit 3e905e2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
14 changes: 11 additions & 3 deletions Makefile
Expand Up @@ -28,6 +28,10 @@ SKINFLATPLUS_VDRLOGO = vdrlogo_default
#DEFINES += -DDEBUGIMAGELOADTIME
#DEFINES += -DDEBUGEPGTIME

# External image lib to use: imagemagick, graphicsmagick
#IMAGELIB = imagemagick
IMAGELIB = graphicsmagick

### The version number of this plugin (taken from the main source file):

VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
Expand Down Expand Up @@ -68,13 +72,17 @@ SOFILE = libvdr-$(PLUGIN).so

### Includes and Defines and Dependencies (add further entries here):

INCLUDES += $(shell pkg-config --cflags Magick++ freetype2 fontconfig)
ifeq ($(IMAGELIB), imagemagick)
INCLUDES += $(shell pkg-config --cflags Magick++ freetype2 fontconfig)
LIBS += $(shell pkg-config --libs Magick++)
else ifeq ($(IMAGELIB), graphicsmagick)
INCLUDES += $(shell pkg-config --cflags GraphicsMagick++ freetype2 fontconfig)
LIBS += $(shell pkg-config --libs GraphicsMagick++)
endif

DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DVDRLOGO=\"$(SKINFLATPLUS_VDRLOGO)\"
DEFINES += -DWIDGETFOLDER='"$(SKINFLATPLUS_WIDGETDIR)"'

LIBS += $(shell pkg-config --libs Magick++)

### The object files (add further files here):

OBJS = config.o setup.o imagecache.o imagescaler.o imagemagickwrapper.o imageloader.o baserender.o complexcontent.o textscroller.o displaychannel.o displaymenu.o displaymessage.o \
Expand Down
1 change: 0 additions & 1 deletion imageloader.c
Expand Up @@ -8,7 +8,6 @@
using namespace Magick;

cImageLoader::cImageLoader() {
InitializeMagick(NULL);
logoExtension = "png";
}

Expand Down
1 change: 0 additions & 1 deletion imagemagickwrapper.c
Expand Up @@ -4,7 +4,6 @@
#include "imagescaler.h"

cImageMagickWrapper::cImageMagickWrapper() {
InitializeMagick(NULL);
}

cImageMagickWrapper::~cImageMagickWrapper() {
Expand Down
6 changes: 6 additions & 0 deletions skinflatplus.c
Expand Up @@ -7,6 +7,7 @@
*/
#include <getopt.h>
#include <vdr/plugin.h>
#include <Magick++.h>

#if defined(APIVERSNUM) && APIVERSNUM < 10734
#error "VDR-1.7.34 API version or greater is required!"
Expand Down Expand Up @@ -76,6 +77,11 @@ bool cPluginFlat::ProcessArgs(int argc, char *argv[]) {
return true;
}

__attribute__((constructor)) static void init(void) {
Magick::InitializeMagick(NULL);
}


bool cPluginFlat::Initialize(void) {
Config.Init();
return true;
Expand Down

0 comments on commit 3e905e2

Please sign in to comment.