Reputation: 21
I am somewhat new to linux. I am trying to find any jpg file in a directory structure over 10 MB. I would like to resize them from 6000x4000 to 3000x2000 which should make it less than 10MB. I would like to have the new file ".jpeg" so I can easily find them later. I can run the find command and get what I am looking for, but I cannot seem to figure out how to pipe it correctly into the magick command. Any help would be greatly appreciated.
Upvotes: 1
Views: 34
Reputation: 185600
Like this:
find . -size +10M -name '*.jpg' -exec bash -c '
for img; do convert -resize 3000x2000 "$img" "${img%.jpg}.jpeg"; done
' -- {} +
Upvotes: 2