Skip to content

Commit

Permalink
added crop to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sdepold authored and Rasmus Andersson committed Oct 7, 2010
1 parent be2a64d commit 9f04c8f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -117,6 +117,22 @@ Example with stdin/stdout:
sys.puts('resized kittens.jpg to fit within 256x256px') 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) ## License (MIT)


Copyright (c) 2010 Rasmus Andersson <http://hunch.se/> Copyright (c) 2010 Rasmus Andersson <http://hunch.se/>
Expand Down

0 comments on commit 9f04c8f

Please sign in to comment.