Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a folder containing photos coming from different cameras.

I use Imagemagick to convert to resized and renamed photos in another folder.

Something like this:

convert "*.jpg" \
    -resize 640 -scene 1 \
    "${folder}/${prefix}_%02d.jpg"

The problem is some cameras save photos with "JPG" extension, others with "jpg".

To solve this I used to rename extensions with this:

rename .JPG .jpg *.JPG 2> /dev/null

This won't work on filesystems where I have only read access. How do I glob in IM both *.jpg and *.JPG files?

Thanks for your help

share|improve this question
add comment

1 Answer

I got it:

convert "*.{jpg,JPG}" \
    -resize 640 -scene 1 \
    "${folder}/${prefix}_%02d.jpg"

from here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.