2010-05-14 7 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 스크립트 문제

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

도움말 : 여기에

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

:

+2

이것은 다소 이상합니다. 어떻게 실패합니까? –

답변

0

이 변경합니까?

+0

Bash에서는'$ path' 나'$ dst'에 공백이 없으면 어떤 차이도 없어야합니다. –

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