admin管理员组文章数量:1305151
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.
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.
Share Improve this question edited Feb 4 at 2:39 Gilles Quénot 186k43 gold badges231 silver badges229 bronze badges asked Feb 4 at 1:16 user3613820user3613820 211 bronze badge 2 |1 Answer
Reset to default 2Like this:
find . -size +10M -name '*.jpg' -exec bash -c '
for img; do convert -resize 3000x2000 "$img" "${img%.jpg}.jpeg"; done
' -- {} +
本文标签: findResizing Photos in DirStack Overflow
版权声明:本文标题:find - Resizing Photos in Dir - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741790736a2397641.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
convert
options for this. Then, storage is cheap... – xenoid Commented Feb 4 at 10:45-define jpeg:extent
like this stackoverflow/a/64411598/2836621 – Mark Setchell Commented Feb 8 at 8:58