批处理命令的ImageMagick在一个目录下所有文件和子direcotries转换在Windows [英] Batch command for ImageMagick to convert all files in a directory and sub-direcotries on windows
问题描述
我有一个文件夹和子文件夹在数千SVG的的。我要的是批量转换所有的人都为 JPG 或 PNG 图片。
有人可以帮我写的ImageMagick的(窗口)命令,它可以找到所有的SVG的/转换为JPG使用其原始名称为png,让他们在同一个目录?
下面是该例子的结构:
C:\\ SVG \\ BusinessMan.svg
C:\\ SVG \\型号\\ Home.svg
C:\\ SVG \\下划线\\ underline.svg
和我想它像这样转换后:
C:\\ SVG \\ BusinessMan.svg
C:\\ SVG \\ BusinessMan.jpg
C:\\ SVG \\型号\\ Home.svg
C:\\ SVG \\型号\\ Home.jpg
C:\\ SVG \\下划线\\ underline.svg
C:\\ SVG \\下划线\\ underline.jpg
与 / R
的循环试>从你的根文件夹内的标志:
FOR / R%A IN(* .SVG)DO转换成%〜一%〜dpna.jpg
这个命令将所有的 .SVG
文件转换在子目录从启动您的命令的根文件夹下。
以上命令适用于命令行,如果你打算使用一个批处理文件(.bat)里面的命令要记得使用 %%
而不是%
:
FOR / R %%一个IN(* .SVG)DO转换%%〜一%%〜dpna.jpg
请参阅 ImageMagick的文档的这一页面获取更多信息。
I have thousands of SVG's in a folder and sub-folders. What I want is to batch convert all of them to jpg or png images.
Can someone help me write a command for ImageMagick (windows), which can find and convert all the svg's to jpg/png with their original names and keep them in the same directories?
Here is the example structure:
C:\SVG\BusinessMan.svg
C:\SVG\Models\Home.svg
C:\SVG\Underlines\underline.svg
And I want it like this after conversion:
C:\SVG\BusinessMan.svg
C:\SVG\BusinessMan.jpg
C:\SVG\Models\Home.svg
C:\SVG\Models\Home.jpg
C:\SVG\Underlines\underline.svg
C:\SVG\Underlines\underline.jpg
Try with a FOR
loop with /R
flag from inside your root folder:
FOR /R %a IN (*.svg) DO convert "%~a" "%~dpna.jpg"
this command will convert all the .svg
files in your sub-directories under the root folder you launched your command from.
Above command works for command line, if you plan to use the command inside a batch file (.bat) remember to use %%
instead of %
:
FOR /R %%a IN (*.svg) DO convert "%%~a" "%%~dpna.jpg"
See this page of Imagemagick documentation for more info
这篇关于批处理命令的ImageMagick在一个目录下所有文件和子direcotries转换在Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!