[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 请教如何批处理图片



On 7/14/07, renws <renws1990@sina.com> wrote:
多谢Li Daobing先生了,我用apt-get下载了imagemagick,
然后建立from和to两个文件夹,然后运行命令,但却报错:


> convert: unable to open image `to/from/dsc00347.jpg': 没有那个文件或目录.
> convert: unable to open image `to/from/dsc00348.jpg': 没有那个文件或目录.
> convert: unable to open image `to/from/dsc00349.jpg': 没有那个文件或目录.
> convert: unable to open image `to/from/dsc00357.jpg': 没有那个文件或目录.
> convert: unable to open image `to/from/dsc00358.jpg': 没有那个文件或目录.
> convert: unable to open image `to/from/dsc00359.jpg': 没有那个文件或目录.
> convert: unable to open image `to/from/dsc00360.jpg': 没有那个文件或目录.
> convert: unable to open image `to/from/dsc00361.jpg': 没有那个文件或目录.
> convert: unable to open image `to/from/dsc00362.jpg': 没有那个文件或目录.
> convert: unable to open image `to/from/dsc00363.jpg': 没有那个文件或目录.
> convert: unable to open image `to/from/dsc00364.jpg': 没有那个文件或目录.
> convert: unable to open image `to/from/dsc00365.jpg': 没有那个文件或目录.

我经验浅,不知道怎么改命令,于是在to下面建立了个from子文件夹,再运行就
OK了。


mkdir from
mkdir to
cp *.jpg from
for file in from/*.jpg; do
convert $file -resize 500x375 to/`basename $file`
done

忘了一个地方了,不好意思。



--
LI Daobing

Reply to: