label text sizing help

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
breezin
Posts: 3
Joined: 2012-08-21T19:25:49-07:00
Authentication code: 67789

label text sizing help

Post by breezin »

Having an issue I just can't figure out. We've recently moved servers and some code that used to work on the old server is giving me some trouble. There seems to be a threshold on the label text length where once over a certain length it will no longer resize properly. For an example to show this it is easier to just set a fixed label and then resize the image… It will resize fine down to a certain width and then the text just goes to super small.

The only change is going from a size of 125x to 120x and the output is totally different.

Any ideas?

Version: ImageMagick 6.7.9-0 2012-08-21 Q16

Code: Select all

/usr/local/bin/convert -size 125x15 -gravity center -background lightblue -fill '#324C7D' -font /usr/local/lib/ImageMagick/config/colle3.ttf label:'TEST HIGH SCHOOL' -rotate '0' -distort Arc '' test_label.png
Image

Code: Select all

/usr/local/bin/convert -size 120x15 -gravity center -background lightblue -fill '#324C7D' -font /usr/local/lib/ImageMagick/config/colle3.ttf label:'TEST HIGH SCHOOL' -rotate '0' -distort Arc '' test_label.png
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: label text sizing help

Post by fmw42 »

label: has had some changes to try to fix things like this. It could still be a bug. see http://www.imagemagick.org/script/changelog.php

It could be a font metric issue, also. But why not just leave off the -size or specify the width or height only and let it find the best pointsize?

Why do you have -distort arc in the command with no value?
breezin
Posts: 3
Joined: 2012-08-21T19:25:49-07:00
Authentication code: 67789

Re: label text sizing help

Post by breezin »

Sorry, I just pulled the output from my class that manages the image options. Rotate, Arc, etc are options but just didn't have anything set for them. I ran the code again without the extra stuff and removed the font setting and get the same result:

Code: Select all

/usr/local/bin/convert -size 120x15 -gravity center -background lightblue -fill '#324C7D' label:'TEST HIGH SCHOOL' test_label.png
Image

Code: Select all

/usr/local/bin/convert -size 115x15 -gravity center -background lightblue -fill '#324C7D' label:'TEST HIGH SCHOOL' test_label.png
Image

I also tried to just use -size 115x and left the height blank and got the same result. For our situation we have a fixed location and size that we need to force the text to fit into. But once the text get to a certain length it just pops to that super small size.

Just can't figure this out....
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: label text sizing help

Post by fmw42 »

It would appear to be a bug.

I have reported my tests at posting.php?mode=post&f=3
Post Reply