Using CAPTION generates a single line when should be multiline

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
markth
Posts: 9
Joined: 2013-06-19T03:47:53-07:00
Authentication code: 6789

Using CAPTION generates a single line when should be multiline

Post by markth »

I am using ImageMagick v6.7.5 on OSX under Bitnami MAMP to output some quotations into a large image. I take a background, then overlay a famous quotation and its author, then save the image. The images themselves are quite large (up to around 8,000 pixels x 6,000 pixels).

I am running a PHP script that uses convert:

Code: Select all

convert ani-landscape.jpg \( -background none -fill rgba\(154,134,78,1\) -gravity center -kerning -22 -interline-spacing 1.2 -interword-spacing 90 -font fonts/Delius-Regular.ttf -size 4537x4160 caption:"Lacus convallis a parturient integer lobortis ullamcorper risus hendrerit et leo parturient integer ullamcorper parturient a mauris a parturient metus orci scelerisque interdum dui penatibus magna malesuada parturient." -repage +504+2377 \) \( -background none -fill rgba\(67,59,37,1\) -gravity center -kerning -22 -interline-spacing 11 -interword-spacing 59 -font fonts/Copse-Regular.ttf -size 2767x451 caption:"Quote Author Name" -repage +1389+7119 \) -layers merge 212-outputfile.jpg
Now on very rare occasions the output from the caption line (which is supposed to fill the 4537x4160 area with text of any number of characters from around 25 to over 1,000) fills only one line, like this:

Image

The vast majority of the time the output is fine, like this (which is what it is supposed to look like):

Image

Has anyone experienced this behaviour before? It happens very rarely, like I say - perhaps 1 in 250 times? I can make the text fit the box by slightly changing the interword spacing or kerning, but I want to iron this issue out!
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Using CAPTION generates a single line when should be multiline

Post by dlemstra »

Can you reproduce the issue with the latest version of Imagemagick?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
markth
Posts: 9
Joined: 2013-06-19T03:47:53-07:00
Authentication code: 6789

Re: Using CAPTION generates a single line when should be multiline

Post by markth »

I'm a little scared to upgrade IM as it took me an age to get it installed. I ended up having to use MAMP as it was bundled with it and worked almost out of the box. Is it an easy process?
markth
Posts: 9
Joined: 2013-06-19T03:47:53-07:00
Authentication code: 6789

Re: Using CAPTION generates a single line when should be multiline

Post by markth »

Right - I managed to upgrade IM to the latest version (6.9.2). The problem does still manifest itself.

Any thoughts?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Using CAPTION generates a single line when should be multiline

Post by dlemstra »

Can you share your input file and fonts so we can try to reproduce your issue? And the exact command that produced an output that you did not expect.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply