开发者

Auto width and height with imagemagick?

开发者 https://www.devze.com 2023-01-25 00:14 出处:网络
I\'m creating an image of a string of text with imagemagick and I need both the width and height of the image to conform to the size of the text.

I'm creating an image of a string of text with imagemagick and I need both the width and height of the image to conform to the size of the text.

Currently, I use the "caption" command and specify a width of 300px, so the image is always 300px wide, and开发者_高级运维 the text wraps if it is longer than 300px.

I guess I would need to still specify a maxwidth somewhere in the imagemagick code, so that the text still wraps at 300px.. but I would like width of the image to fit the longest line of the wrapped text and not be exactly 300px. Is this possible?

0

精彩评论

暂无评论...
验证码 换一张
取 消