Meo Beo
Meo Beo

Reputation: 484

Java + ImageMagick: how to figure out height of text based on width?

I'm using ImageMagick with Java in my project. I have a command:

 convert -background lightblue  -fill blue  -font Tahoma -pointsize 36 -size 320x caption:'This is a very long caption line.' caption.gif

This command will create an image named "caption.gif"
The image's width is 320px.
Is there any way that I can figure out the image's height without creating image. Thanks!

Upvotes: 0

Views: 76

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207355

Yes, you can do this:

convert -font Tahoma -pointsize 36 -size 320x caption:'This is a very long caption line.' -format "%h" info:
88

Upvotes: 1

Related Questions