montage - ignore specific file?

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
User avatar
teracow
Posts: 19
Joined: 2013-04-30T02:55:12-07:00
Authentication code: 6789
Location: Brisbane, Australia

montage - ignore specific file?

Post by teracow »

Hello,

using: ImageMagick 6.8.9-8 Q16 x86_64 2016-05-05
on: OpenSUSE 13.2 64b

Is there a way to force montage to grab everything in a directory except for specific files? Or will I need to send it a list of files (minus the ones I dont want)?

if I have these files:

Code: Select all

a.gif
b.jpeg
c.png
d.abc
and then run:

Code: Select all

$ montage * output.png
I get:

Code: Select all

montage: no decode delegate for this image format `ABC' @ error/constitute.c/ReadImage/501.
The output image is still created, but it causes montage to exit with error code 1. I'm trying to avoid this. So I need to tell it to ignore or skip 'd.abc' or to only process MIME image types.

Any ideas?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: montage - ignore specific file?

Post by fmw42 »

IM looks to see if you have valid image types and apparently does not recognize .abc as proper or the image does not have a proper/valid magick value (%m). IM mostly uses delegate libraries for different image formats, such as JPG, PNG, TIFF.

I suspect you will need to filter your list of images to standard suffixes. You can do that with the unix tools cd, ls and grep and pipe that to montage. grep -v will exclude the names

Code: Select all

ls | grep -v "abc" | montage - ....
User avatar
teracow
Posts: 19
Joined: 2013-04-30T02:55:12-07:00
Authentication code: 6789
Location: Brisbane, Australia

Re: montage - ignore specific file?

Post by teracow »

Okiedoke. Thanks Fred. :)
Post Reply