2010-05-14 162 views
0
// This works 
convert ${path}${dst} -crop ${crop} ${path}${dst} 

// but when changed to this, it fails 
convert ${path}${src} -trim ${path}${dst} 
convert ${path}${dst} -crop ${crop} ${path}"pdf_"${dst} 

我在做什么错?ImageMagick bash脚本问题

+2

这有点神秘 - 它是如何失败的? – 2010-05-14 12:58:46

回答

0

是否改变这一点:

convert ${path}${dst} -crop ${crop} ${path}"pdf_"${dst} 

要这样:

convert ${path}${dst} -crop ${crop} "${path}pdf_${dst}" 

帮助?

+0

在Bash中,除非'$ path'或'$ dst'中有空格,否则不应有任何区别。 – 2010-05-14 13:17:00

0

适合我。

$ path=./ 
$ src=test.jpg 
$ dst=test2.jpg 
$ crop=100x100+10+10 
$ convert ${path}${src} -trim ${path}${dst} 
$ convert ${path}${dst} -crop ${crop} ${path}pdf_${dst} 
$ identify pdf_test2.jpg 
pdf_test2.jpg JPEG 100x100 100x100+0+0 DirectClass 8-bit 3.30078kb