Skip to content

Commit 145bffe

Browse files
committed
update docs with alternative constructor
1 parent bdb8ca8 commit 145bffe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ The Jimp constructor takes two arugments, the path to a JPEG or PNG image and an
2828
// ready
2929
});
3030

31+
Alternatively, the Jimp constructor can take a Buffer object containing the image data and the string MIME type:
32+
33+
var image = new Jimp(data, "image/png", function () {
34+
// ready
35+
});
36+
3137
Once the callback has fired the following methods can be called on the image:
3238

3339
image.crop( x, y, w, h ); // crop to the given region

0 commit comments

Comments
 (0)