简体   繁体   中英

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!

Yes, you can do this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM