Switching input file mid command
Posted: 2011-01-28T09:31:10-07:00
I'm working on a site that is forced to use a media conversion server. That server lets me issue the imagemagick parameters, but not the actual convert command, so multiple commands are out.
I have an image that I need resized, then I need that resized image cropped twice. I need all three resulting images saved separately.
Doing multiple calls to the conversion server will mean I basically have to develop a communication system between all the requests, so that I know when to do the next step, since the server uses callback urls and I don't have control over the info it sends back.
I've been playing around with something like this,
convert ./image.png -resize 160x320 -write ./image-resize.png -crop 50x50+15+15 -write ./image-cropped-1.png -crop 25x25+10+10 ./image-cropped-2.png
But the second crop will crop the result of the first crop. Is there way to do two different crops on the resized image in the same command?
Thanks,
Brandon
I have an image that I need resized, then I need that resized image cropped twice. I need all three resulting images saved separately.
Doing multiple calls to the conversion server will mean I basically have to develop a communication system between all the requests, so that I know when to do the next step, since the server uses callback urls and I don't have control over the info it sends back.
I've been playing around with something like this,
convert ./image.png -resize 160x320 -write ./image-resize.png -crop 50x50+15+15 -write ./image-cropped-1.png -crop 25x25+10+10 ./image-cropped-2.png
But the second crop will crop the result of the first crop. Is there way to do two different crops on the resized image in the same command?
Thanks,
Brandon