张金龙的博客分享 http://blog.sciencenet.cn/u/zjlcas 物种适应性、分布与进化

博文

ImageMagick批量调整多个文件夹下照片的尺寸

已有 5822 次阅读 2017-8-24 10:50 |个人分类:软件介绍|系统分类:科研笔记|关键词:学者

1. #### Install ImageMagick https://www.imagemagick.org/script/index.php

安装 ImageMagick

2. #### Make sure the command mogrify could be called from CMD

安装时选择添加路径,以便mogrify组建能够从CMD调用。


#### Run the following R code

运行以下R代码。location为照片所保存的文件夹。


location ="D:/photos"

setwd(location)

dirs <- list.dirs(path = location, full.names =TRUE, recursive =TRUE)

for(i in 1:length(dirs)){

   temp <- dirs[i]

   setwd(temp)

   system("mogrify -resize 2909x4000 -density 72 *.jpg")

   print(paste("Resizing",temp))

}


##### 更多选项参见 mogrify的帮助。




https://m.sciencenet.cn/blog-255662-1072529.html

上一篇:用HUGO生成静态网站
下一篇:鼓--写给村里的侠客

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-3-28 18:54

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部