Page 1 of 1

montage: wordwrap of long labels

Posted: 2012-01-26T14:33:44-07:00
by f.gruber
Hi,
is there any way to wordwrap long filenames?
I use this command:

Code: Select all

montage -label %f -geometry 150x150+10+10 *.jpg outfile.jpg
In my example the filenames are too long for the given size of 150x150 and therefore they are overlapped. That looks ugly.
Is there any way to work around this?

Thank you for tipps.
Ferdinand

Re: montage: wordwrap of long labels

Posted: 2012-01-26T16:10:23-07:00
by fmw42
I don't believe that montage has the equivalent to caption: that does word wrapping. However, even that is at word boundaries. So it would not help if your filenames do not have white spaces.

You can set the font and pointsize to a smaller value to save space in montage. see http://www.imagemagick.org/Usage/montage/#settings

You can also increase the -geometry size so that there is more space for the filenames.

The only other thing I can think of is for you to add comments to each of your images with the filename or whatever formatted (with \n) the way you might want (every so many characters) and then use -label "%c" with montage. However, I am not sure what happens with the \n in comments.
see http://www.imagemagick.org/Usage/montage/#metadata

However, having an automatic wrap at the width of the image would make a useful enhancement to montage, if it is practical to do so.