rsms/node-imagemagick — pull request #68 by marcweil (2012-11-12 03:27:44+00:00)
Title: Support arbitrary cropping rectangles with im.crop().

IM is sensitive to the order of arguments on the command line. There were 2 problems preventing cropping with an arbitrary rectangle:

1. `-resize` was being placed before `-crop` which makes everything hard to calculate. My changes remove `-resize` from the command line if `top` and `left` are present in the options passed to `crop()`.
1. The `crop` function's options object didn't accept any notion of `top` or `left` to specify the top-left coordinate within the image of the top-left of the crop rectangle. My changes allow this to happen and use them in the `crop` function.