Good day, I am using Montage to create a Contact_Sheet.jpg in several direcrories, one contact sheet per directory. However some of the directories have small video files (.mp4 or .mpg) along with the JPG, TIFF, PNG and RAW files, is there a way to specifically exclude files such --exclude *,mpg ? or similar.
ImageMagick 7.0.7-22 Q16 x86_64 2018-01-13 for Mac OSX
Thanks in advance
Montage - Exclude Videos ?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Montage - Exclude Videos ?
You can just list the formats you want. For example:
Code: Select all
magick montage *.jpg *.tif -tile x1 result.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Montage - Exclude Videos ?
This will exclude jpg from the directory
where i have use
ls | grep -v "\.jpg$"
to make a list of all files in the directory excluding .jpg
Search google and you will find other methods.
Code: Select all
magick montage $(ls | grep -v "\.jpg$") -tile x1 tmp.png
ls | grep -v "\.jpg$"
to make a list of all files in the directory excluding .jpg
Search google and you will find other methods.
Re: Montage - Exclude Videos ?
Excellent, thanks for the help guys this is great.
The excluding specific formats with Grep seems like a great way to go.
$(ls | grep -v "\.mpg$")
The excluding specific formats with Grep seems like a great way to go.
$(ls | grep -v "\.mpg$")
---
Sum Duud, Oz.
Sum Duud, Oz.
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Montage - Exclude Videos ?
Also, most versions of "ls" will accept an "--ignore" option. To omit the MPGs from the listing, try something like this...
Code: Select all
ls --ignore "*.mpg"
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Montage - Exclude Videos ?
At least on my installation the "ls" that comes with Windows 10 bash accepts that "--ignore" option. Maybe it's not as common as I thought.
I have an "ls" that comes as part of a GNU32 package and runs from the Windows command line. It takes an upper-case "-I" option. This ignores the "*.mpg" files...
Code: Select all
ls -I"*.mpg"
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Montage - Exclude Videos ?
That option is not available on my Mac either. I checked that also earlier as per some Google searches. I think it because Mac is not using GNU unix. I have had trouble before with the Mac Unix not being as flexible as GNU.
P.S. Those were both good suggestions and I found them also by doing a Google search. But they just don't work on the Mac. So I generally try to use solutions that work on my Mac, since they generally also work in other Linux systems.
P.S. Those were both good suggestions and I found them also by doing a Google search. But they just don't work on the Mac. So I generally try to use solutions that work on my Mac, since they generally also work in other Linux systems.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Montage - Exclude Videos ?
"ls --include '*.mpg'" and "ls -I '*.mpg'" work fine on the ls that comes with Cygwin, on my Windows 8.1. It works both in bash, and from the Windows CMD prompt.
snibgo's IM pages: im.snibgo.com