Clipping with caption on version 6.8.8-10

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
sschmitt
Posts: 2
Joined: 2014-04-02T08:13:55-07:00
Authentication code: 6789

Clipping with caption on version 6.8.8-10

Post by sschmitt »

Hi,

the following code:

Code: Select all

convert input.png ( -size 350x55 -background transparent -fill '#FFFFFF' -gravity west -font Helvetica-Bold caption:'Universale, hoch pigmentierte Acrylfarbe für den Kunst-' -trim +repage ) -gravity WEST -geometry +40+5 -composite output1.png
will create an image, where the text is bigger than the bounds specified by the "-size" argument:
Image

I tried changing the font, but got another clipped text with the following code:

Code: Select all

convert input.png ( -size 350x55 -background transparent -fill '#FFFFFF' -gravity west -font Times-Bold -weight 1000 caption:'Universale, hoch pigmentierte Acrylfarbe für den Kunst-, Design- und Dekorbe Universale, hoch pigmentierte Acrylfarbe für den Kunst-, Design-' -trim +repage ) -gravity WEST -geometry +40+5 -composite output2.png
Image

I tried the same with an older version of Imagemagick (6.6.5-10), and it sized the text correctly.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Clipping with caption on version 6.8.8-10

Post by fmw42 »

This works perfectly fine for me on IM 6.8.8.10 Q16 Mac OSX


convert -size 350x55 -background black -fill '#FFFFFF' -gravity west -font Helvetica-Bold caption:'Universale, hoch pigmentierte Acrylfarbe für den Kunst-' -trim +repage tmp.png

Image

It is the first part of your command, but I changed transparent to black to allow it to show. Transparent also works fine. Do you get a good result for just that part?
sschmitt
Posts: 2
Joined: 2014-04-02T08:13:55-07:00
Authentication code: 6789

Re: Clipping with caption on version 6.8.8-10

Post by sschmitt »

The same command for me returned:
Image

Your font also looks different from my "Helvetica-Bold". I tried the same command, but with "Helvetica-BoldOblique" and got this image:
Image
This looks more like your font, but still has the same problem.

I use version
Version: ImageMagick 6.8.8-10 Q16 x86_64 2014-04-01 http://www.imagemagick.org
on the OS
CentOS release 5.10 (Final)

Any idea what may cause the difference?

Edit:
I compared the -list configure output from the working and the non working installation.
Working:

Code: Select all

CC            gcc -std=gnu99 -std=gnu99
CFLAGS        -fopenmp -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -pthread
CONFIGURE     ./configure  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-shared' '--disable-static' '--with-modules' '--with-perl' '--with-x' '--with-threads' '--with-magick_plus_plus' '--with-gslib' '--with-wmf' '--with-lcms' '--with-rsvg' '--with-xml' '--with-perl-options=INSTALLDIRS=vendor  CC='\''gcc -L/builddir/build/BUILD/ImageMagick-6.6.5-10/magick/.libs'\'' LDDLFLAGS='\''-shared -L/builddir/build/BUILD/ImageMagick-6.6.5-10/magick/.libs'\''' '--without-dps' '--without-included-ltdl' '--with-ltdl-include=/usr/include' '--with-ltdl-lib=/usr/lib64' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
COPYRIGHT     Copyright (C) 1999-2010 ImageMagick Studio LLC
CPPFLAGS      -I/usr/include/ImageMagick
CXX           g++
CXXFLAGS      -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -pthread
DEFS          -DHAVE_CONFIG_H
DELEGATES     bzlib djvu fontconfig freetype gs jpeg jng jp2 lcms openexr png rsvg tiff x11 xml wmf zlib
DISTCHECK_CONFIG_FLAGS 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-dps=no --with-fontpath=
EXEC-PREFIX   /usr
FEATURES      OpenMP 
HOST          x86_64-redhat-linux-gnu
LDFLAGS       -L/usr/lib64 
LIB_VERSION   0x665
LIB_VERSION_NUMBER 6,6,5,10
LIBS          -lMagickCore -llcms -ltiff -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread -lltdl
NAME          ImageMagick
PCFLAGS       -fopenmp
PREFIX        /usr
QuantumDepth  16
RELEASE_DATE  2011-11-03
VERSION       6.6.5
WEBSITE       http://www.imagemagick.org

Path: [built-in]

Name          Value
-------------------------------------------------------------------------------
NAME          ImageMagick
Not working:

Code: Select all

Path: /usr/local/lib/ImageMagick-6.8.8//config-Q16/configure.xml

Name           Value
-------------------------------------------------------------------------------
CC             gcc -std=gnu99 -std=gnu99
CFLAGS         -I/usr/include/freetype2 -fopenmp -g -O2 -Wall -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
CODER_PATH     /usr/local/lib/ImageMagick-6.8.8/modules-Q16/coders
CONFIGURE      ./configure  '--prefix=/usr/local' '--with-bzlib=yes' '--with-fontconfig=yes' '--with-freetype=yes' '--with-gslib=yes' '--with-gvc=yes' '--with-jpeg=yes' '--with-jp2=yes' '--with-png=yes' '--with-tiff=yes'
CONFIGURE_PATH /usr/local/etc/ImageMagick-6/
COPYRIGHT      Copyright (C) 1999-2014 ImageMagick Studio LLC
CPPFLAGS       -I/usr/local/include/ImageMagick-6
CXX            g++
CXXFLAGS       -pthread
DEFS           -DHAVE_CONFIG_H
DELEGATES      bzlib mpeg freetype gslib jng jpeg png ps tiff zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-fontpath= --with-mupdf=no --with-rsvg=no --with-wmf=no --with-perl=no
DOCUMENTATION_PATH /usr/local/share/doc/ImageMagick-6
EXEC-PREFIX    /usr/local
EXECUTABLE_PATH /usr/local/bin
FEATURES       DPC OpenMP
FILTER_PATH    /usr/local/lib/ImageMagick-6.8.8/modules-Q16/filters
HOST           x86_64-unknown-linux-gnu
INCLUDE_PATH   /usr/local/include/ImageMagick-6
LDFLAGS        -L/usr/local/lib
LIB_VERSION    0x688
LIB_VERSION_NUMBER 6,8,8,10
LIBRARY_PATH   /usr/local/lib/ImageMagick-6.8.8
LIBS           -ltiff -lfreetype -ljpeg -lgs -lpng12 -lbz2 -lz -lm -lgomp
NAME           ImageMagick
PCFLAGS        -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
PREFIX         /usr/local
QuantumDepth   16
RELEASE_DATE   2014-04-01
SHARE_PATH     /usr/local/share/ImageMagick-6
SHAREARCH_PATH /usr/local/lib/ImageMagick-6.8.8/config-Q16
SVN_REVISION   15238
TARGET_CPU     x86_64
TARGET_OS      linux-gnu
TARGET_VENDOR  unknown
VERSION        6.8.8
WEBSITE        http://www.imagemagick.org

Path: [built-in]

Name           Value
-------------------------------------------------------------------------------
FEATURES       OpenMP
NAME           ImageMagick
QuantumDepth   16
The one thing I noticed was that in the delegates of the non-working installation, "fontconfig" is missing. Could that explain a weird font sizing? I tried to find out what exactly fontconfig is, but to me it seemed that it's only for finding installed fonts, not displaying them.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Clipping with caption on version 6.8.8-10

Post by fmw42 »

Only thing I can suggest is try other Helvetica-Bold fonts. Perhaps you have a bad set.
Post Reply