Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added crop to readme

  • Loading branch information...
commit 9f04c8fa5fd5a281ca9400c54507ecd17612a340 1 parent be2a64d
@sdepold sdepold authored committed
Showing with 16 additions and 0 deletions.
  1. +16 −0 README.md
View
16 README.md
@@ -117,6 +117,22 @@ Example with stdin/stdout:
sys.puts('resized kittens.jpg to fit within 256x256px')
});
+### crop(options, callback) ###
+Convenience function for resizing and cropping an image. _crop_ uses the resize method, so _options_ and _callback_ are the same. _crop_ uses options.srcPath, so make sure you set it :) Using only _options.width_ or _options.height_ will create a square dimensioned image.
+
+Example:
+
+ im.crop({
+ srcPath: path,
+ dstPath: 'cropped.jpg',
+ width: 800,
+ height: 600,
+ quality: 1
+ }, function(err, stdout, stderr){
+ // foo
+ })
+
+
## License (MIT)
Copyright (c) 2010 Rasmus Andersson <http://hunch.se/>
Please sign in to comment.
Something went wrong with that request. Please try again.