Mobile app version of vmapp.org
Login or Join
Alves566

: How to provide label for montage by text file I use Ubuntu 14.0.4. We can use this command of ImageMagick to label each image by it's name: montage -label '%t' -size 512x512 "./img/*.*[120x90]"

@Alves566

Posted in: #Imagemagick #Images #Photomontage

I use Ubuntu 14.0.4. We can use this command of ImageMagick to label each image by it's name:

montage -label '%t' -size 512x512 "./img/*.*[120x90]" -geometry +5+5 photo.png


I want to label images by list of strings, which is written in a text file. Docs say:


-label name

assign a label to an image.

Use this option to assign a specific label to the image ...
If the first character of string is @ , the image label is read from a
file titled by the remaining characters in the string. Labels in a
file are literal, no embedded formatting characters are recognized.


But I could not use a file to provide label. I use a command like this:

montage -label @un .txt -size 512x512 "./img/*.*[120x90]" -geometry +5+5 photo.png


Above, un.txt is the name of text file in ./img/ path. This is a sample result:



In result, all images labeled by string @un .txt instead of content of un.txt. Also I get this error in terminal:


montage.im6: improper image header `./img/un.txt' @
error/txt.c/ReadTXTImage/429


If I move un.txt to the current (.) directory and run above command again, I will get this image (there is no label) and below error:




montage.im6: not authorized `@un.txt' @
error/property.c/InterpretImageProperties/2959.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Alves566

1 Comments

Sorted by latest first Latest Oldest Best

 

@Odierno310

With attention to this answer, I found it is probably related to the vulnerability discovered in ImageMagick (here), so I updated my site policy file by removing <policy domain="path" rights="none" pattern="@*" /> line from /etc/ImageMagick/policy.xml. Now montage reads from file.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme