Imagemagick'convert':如何简单地为图像文件夹创建缩略图并保留其文件名?

时间:2022-07-27 08:57:34

I have a folder /images/

我有一个文件夹/ images /

I'd like to use imagemagick to go through every image in that folder and create a thumbnail and store it in

我想使用imagemagick浏览该文件夹中的每个图像并创建缩略图并将其存储

/images/thumbs

and retain the filename

并保留文件名

I can't find any example of how to do that (batch style) using terminal?

我找不到任何使用终端如何做到这一点(批处理样式)的例子?

1 个解决方案

#1


0  

here is some skeleton

这是一些骨架

md thumbs
for %%f in (*.jpg) do (
  gm convert -convert_commands_here %%f thumbs\%%~nf.jpg 
)

you can base your script on. This batch script processes all .jpg files in the current directory and saves the converted images into a thumbs subdirectory

你可以根据你的脚本。此批处理脚本处理当前目录中的所有.jpg文件,并将转换后的图像保存到thumbs子目录中

#1


0  

here is some skeleton

这是一些骨架

md thumbs
for %%f in (*.jpg) do (
  gm convert -convert_commands_here %%f thumbs\%%~nf.jpg 
)

you can base your script on. This batch script processes all .jpg files in the current directory and saves the converted images into a thumbs subdirectory

你可以根据你的脚本。此批处理脚本处理当前目录中的所有.jpg文件,并将转换后的图像保存到thumbs子目录中