Caption uses tiny text

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
User avatar
powerofvoid
Posts: 11
Joined: 2015-03-04T07:58:38-07:00
Authentication code: 6789

Caption uses tiny text

Post by powerofvoid »

Code: Select all

convert -size 300x700 caption:"fe fi fo fum" test.jpg
Got the left, expected something more like the right
Image Image

Code for the right side version:

Code: Select all

 convert -size 300x700 -pointsize 180 caption:"fe fi fo fum" test2.jpg

Might be because I went back to using an old version of imagemagick when I reinstalled.

Code: Select all

convert --version
Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP    
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Caption uses tiny text

Post by fmw42 »

You need an upgrade. It works fine for me with

Code: Select all

convert -size 300x700 caption:"fe fi fo fum" test.jpg
using IM 6.9.1.4 Q16 Mac OSX. Very similar to your right side image.

Your IM version is about 140 versions old!
User avatar
powerofvoid
Posts: 11
Joined: 2015-03-04T07:58:38-07:00
Authentication code: 6789

Re: Caption uses tiny text

Post by powerofvoid »

I'll try that
User avatar
powerofvoid
Posts: 11
Joined: 2015-03-04T07:58:38-07:00
Authentication code: 6789

Re: Caption uses tiny text

Post by powerofvoid »

Well, that works for small amounts of text, but...

Code: Select all

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut pellentesque auctor pulvinar. Ut semper enim mauris, a gravida leo eleifend quis. Integer semper odio sapien, ut dictum nunc sagittis ut. Cras bibendum erat sit amet lorem malesuada varius. Pellentesque tempor, sapien vitae tempus euismod, purus dui eleifend odio, id facilisis ex sapien sed eros. Sed nec tortor a lectus lobortis luctus sit amet quis enim. Phasellus vel felis nibh.

Suspendisse tincidunt lacus risus. Vivamus auctor eget sem eu luctus. Maecenas ac nulla gravida, lacinia ipsum in, venenatis mauris. Nam interdum consectetur bibendum. Sed dictum, metus in consectetur fermentum, odio est luctus orci, sed efficitur metus nulla eu elit. Sed vel tristique erat, eget laoreet turpis. Pellentesque eget arcu nec lacus fermentum placerat. Donec vestibulum leo id ex mollis dignissim. Integer ut sollicitudin augue, in pharetra ligula. Morbi a mi in eros dapibus vulputate sit amet sit amet dui. Mauris mattis, sapien a lacinia iaculis, libero mi rhoncus lorem, quis eleifend metus augue eget elit.

Integer placerat convallis ipsum, vitae placerat nulla vehicula id. Sed ut mi purus. Mauris placerat justo nibh, eu sodales orci blandit vitae. Donec cursus elementum auctor. Suspendisse mauris diam, aliquam sit amet neque et, dapibus malesuada lectus. Suspendisse et tristique nulla. Aenean libero erat, malesuada ac massa a, faucibus tincidunt neque. Phasellus eu nibh posuere, commodo leo id, rhoncus leo. Maecenas ac laoreet odio. In hac habitasse platea dictumst. In sit amet sapien nec lectus vestibulum vestibulum vestibulum ac felis. Aliquam imperdiet semper erat, at laoreet nisi iaculis et. Donec lacinia eu neque at semper. Phasellus ligula magna, consequat sed rhoncus ac, tempor at dui. Suspendisse imperdiet viverra turpis in varius. Curabitur a congue enim, sit amet sagittis lorem.

Vestibulum pharetra quis urna at pharetra. Cras vitae consectetur ipsum. Aenean et dapibus odio. Phasellus enim felis, condimentum nec quam sed, tempor ultricies purus. Nulla facilisi. Phasellus aliquet molestie eros, sit amet lacinia felis. Fusce tempor enim et elit mollis, vel bibendum dui sagittis. Vestibulum vehicula sit amet nisl vel mattis. Proin non cursus ex. Sed tristique lectus eros, nec consequat risus aliquet eu. Ut dui mauris, euismod eu pulvinar eu, sodales sit amet dui. Pellentesque euismod egestas velit, at imperdiet eros molestie nec.

Code: Select all

convert -size 300x700 -caption:@lorempipsum.txt test5.jpg
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Caption uses tiny text

Post by fmw42 »

convert -size 300x700 -caption:@lorempipsum.txt test5.jpg
No -caption: ---- remove the minus before caption

My guess is that there is too much text for the smallest pointsize you have on your system for the default font and this may mess up IM's ability to render it properly.

If you cut back on the amount of text and slowly build up, it seems to work fine, until you reach a point where it has no smaller fonts to use.

At that point, you will need to specify the desired pointsize that works for you. Such as

Code: Select all

convert -size 300x700 -pointsize 11 caption:@lorempipsum.txt test5.jpg
User avatar
powerofvoid
Posts: 11
Joined: 2015-03-04T07:58:38-07:00
Authentication code: 6789

Re: Caption uses tiny text

Post by powerofvoid »

fmw42 wrote:
convert -size 300x700 -caption:@lorempipsum.txt test5.jpg
No -caption: ---- remove the minus before caption

Code: Select all

convert -verbose -size 300x700 caption:@lorempipsum.txt test.jpg
Well, now it just keeps running for several minutes with no output.
My guess is that there is too much text for the smallest pointsize you have on your system for the default font and this may mess up IM's ability to render it properly.

If you cut back on the amount of text and slowly build up, it seems to work fine, until you reach a point where it has no smaller fonts to use.
Except that, as you pointed out, 11point font seems to work fine. Why is it using a font smaller than 11p?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Caption uses tiny text

Post by fmw42 »

caption: without the minus is correct. Sometimes it takes a long time to render and if it is confused about the correct size, then it could be slow. Does it work without the line breaks?

Perhaps there is a bug. The developers will need to respond.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Caption uses tiny text

Post by magick »

The caption code is modest in its capabilities. For more robust text, use Pango. See http://www.imagemagick.org/Usage/text/#pango. With caption, we got slightly better results by formatting the text. We used fmt -60 to reformat the text and the caption looked reasonable.
User avatar
powerofvoid
Posts: 11
Joined: 2015-03-04T07:58:38-07:00
Authentication code: 6789

Re: Caption uses tiny text

Post by powerofvoid »

Pango seems to be working much better.

EDIT: Except that it doesn't automatically assign a font size to fill the space, which is an important part of what I'm trying to do.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Caption uses tiny text

Post by fmw42 »

magick wrote: With caption, we got slightly better results by formatting the text. We used fmt -60 to reformat the text and the caption looked reasonable.
How does one apply fmt -60? Is that a feature in the command line when using caption: or just in the caption: code? If in the code, is that being added in IM 6.9.1.5?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Caption uses tiny text

Post by magick »

The fmt utility is a command-line utility for formatting text. We use it from the vi editor like this:
  • -> vi lorempipsum.txt
    :%!fmt -60
Post Reply