views:

80

answers:

2
// 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}

What am I doing wrong?

A: 

Does changing this:

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

To this:

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

Help?

Tim Post
In Bash, that shouldn't make any difference unless there are spaces in `$path` or `$dst`.
Dennis Williamson
A: 

Works fine for me.

$ 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
Eric Seppanen