Image -> draw() problems when drawing text

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
MuTaTeD
Posts: 1
Joined: 2014-04-09T04:42:14-07:00
Authentication code: 6789

Image -> draw() problems when drawing text

Post by MuTaTeD »

Hi,
I complied Magick on Mac with static libraries with support for Magick++.

Now I am trying to execute the following example from the Magick++ tutorial pdf on page 19 ( I have removed the comments from the following code)

Code: Select all

    DrawableText::DrawableText(double x, double y, const string& text_to_write)
    Image my_image(Geometry(320,220), Color("white"));

    list<Drawable> text_draw_list;
    text_draw_list.push_back(DrawableFont("-misc-fixed-medium-o-semicondensed—13-*-*-*-c-60-iso8859-1"));
    text_draw_list.push_back(DrawableText(101, 50, "text to write on the canvas"));
    text_draw_list.push_back(DrawableStrokeColor(Color("black")));
    text_draw_list.push_back(DrawableFillColor(Color(0, 0, 0, MaxRGB)));

    my_image.draw(text_draw_list);
I get the following error:
Magick: non-conforming drawing primitive definition `text' @ error/draw.c/DrawImage/3193
Can you help me figure this out.

Also I cannot use annotate as I have not compiled X support in my libraries...

Here is the output from my configure
Option Value
-------------------------------------------------------------------------------
Shared libraries --enable-shared=no no
Static libraries --enable-static=yes yes
Module support --with-modules=no no
GNU ld --with-gnu-ld=no no
Quantum depth --with-quantum-depth=16 16
High Dynamic Range Imagery
--enable-hdri=no no

Install documentation: yes

Delegate Configuration:
BZLIB --with-bzlib=yes yes
Autotrace --with-autotrace=no no
Dejavu fonts --with-dejavu-font-dir=default none
DJVU --with-djvu=yes no
DPS --with-dps=yes no
FFTW --with-fftw=yes no
FlashPIX --with-fpx=yes no
FontConfig --with-fontconfig=yes no
FreeType --with-freetype=yes no
GhostPCL None pcl6 (unknown)
GhostXPS None gxps (unknown)
Ghostscript None gs (unknown)
Ghostscript fonts --with-gs-font-dir=default none
Ghostscript lib --with-gslib=no no
Graphviz --with-gvc=no
JBIG --with-jbig=yes no (failed tests)
JPEG v1 --with-jpeg=yes yes
JPEG-2000 --with-jp2=
LCMS v1 --with-lcms=yes no
LCMS v2 --with-lcms2=yes no
LQR --with-lqr=yes no
LTDL --with-ltdl=yes no
LZMA --with-lzma=yes yes
Magick++ --with-magick-plus-plus=yes yes
MUPDF --with-mupdf=no no
OpenEXR --with-openexr=yes no
OpenJP2 --with-openjp2=yes no
PANGO --with-pango=yes no
PERL --with-perl=no no
PNG --with-png=yes yes
RSVG --with-rsvg=no no
TIFF --with-tiff=yes yes
WEBP --with-webp=yes no
Windows fonts --with-windows-font-dir= none
WMF --with-wmf=no no
X11 --with-x=no no
XML --with-xml=yes yes
ZLIB --with-zlib=yes yes

X11 Configuration:
X_CFLAGS =
X_PRE_LIBS =
X_LIBS =
X_EXTRA_LIBS =

Options used to compile and link:
PREFIX = /Users/awais/Downloads/Image_Magick/IMagick/im
EXEC-PREFIX = /Users/awais/Downloads/Image_Magick/IMagick/im
VERSION = 6.8.8
CC = clang
CFLAGS = -arch x86_64 -Wall -fexceptions -D_FORTIFY_SOURCE=0 -D_THREAD_SAFE -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
CPPFLAGS = -I/Users/awais/Downloads/Image_Magick/IMagick/im/include/ImageMagick-6
PCFLAGS = -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
DEFS = -DHAVE_CONFIG_H
LDFLAGS = -L/Users/awais/Downloads/Image_Magick/IMagick/im/tmp/lib -arch x86_64 -L/Users/awais/Downloads/Image_Magick/IMagick/ImageMagick-6.8.8-10/magick -L/Users/awais/Downloads/Image_Magick/IMagick/ImageMagick-6.8.8-10/wand -L/opt/local/lib
MAGICK_LDFLAGS = -L/Users/awais/Downloads/Image_Magick/IMagick/im/lib -L/Users/awais/Downloads/Image_Magick/IMagick/im/tmp/lib -arch x86_64 -L/Users/awais/Downloads/Image_Magick/IMagick/ImageMagick-6.8.8-10/magick -L/Users/awais/Downloads/Image_Magick/IMagick/ImageMagick-6.8.8-10/wand -L/opt/local/lib
LIBS = -ltiff -ljpeg -lpng16 -L/opt/local/lib -llzma -lbz2 -lxml2 -lz -lm
CXX = clang
CXXFLAGS = -arch x86_64 -D_THREAD_SAFE -pthread
FEATURES = DPC
DELEGATES = bzlib mpeg jng jpeg lzma png tiff xml zlib
Post Reply