[ale] Bulk jpg Thumbnail production from 137000 jp2 files??

Phil Turmel philip at turmel.org
Wed Feb 20 10:58:38 EST 2013


Hi Wolf,

On 02/20/2013 09:31 AM, Wolf Halton wrote:
> Hi James - Thanks.
> Works, but I am trying to convert files in sub-folders
> find -type f -name "*.jp2" -exec convert {} -resize 14% *.jpg \;
> was doing something, but basically it took each image in order and created
> a file called *.jpg in the parent directory, over and over. Looking at it
> in image-viewer is like watch ing a slow slide show, as the image changes.

I think you are suffering from a common misunderstanding of how
wildcards work in linux versus that *other OS*.

In Wi***ws, wildcards are passed to the executable and that executable
can interpret them however it chooses.

In Linux (and *nixes in general), the shell evaluates the wildcards and
passes the files found as separate arguments to the executable.  The
program will only see the wildcard if there's no match at all, or if you
use single quotes.  (But most linux programs don't expect to see
wildcards.)  If you put a wildcard where a program is expecting an
output filename, it won't work as you expect (if at all).

You need to use bash's or find's substitutions on both the input file
name and the output file name so "convert" sees them correctly.  You can
experiment with this sort of thing by putting "echo " in front of
"convert" to see the command line that is being executed.

Phil


More information about the Ale mailing list