File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -590,6 +590,7 @@ This module would never have been possible without the help and code contributio
590590* [ Julian Walker] ( https://github.com/julianwa )
591591* [ Amit Pitaru] ( https://github.com/apitaru )
592592* [ Brandon Aaron] ( https://github.com/brandonaaron )
593+ * [ Andreas Lind] ( https://github.com/papandreou )
593594
594595Thank you!
595596
Original file line number Diff line number Diff line change 1010 " Daniel Gasienica <daniel@gasienica.ch>" ,
1111 " Julian Walker <julian@fiftythree.com>" ,
1212 " Amit Pitaru <pitaru.amit@gmail.com>" ,
13- " Brandon Aaron <hello.brandon@aaron.sh>"
13+ " Brandon Aaron <hello.brandon@aaron.sh>" ,
14+ " Andreas Lind <andreas@one.com>"
1415 ],
1516 "description" : " High performance Node.js module to resize JPEG, PNG and WebP images using the libvips library" ,
1617 "scripts" : {
4546 "nan" : " ^1.3.0"
4647 },
4748 "devDependencies" : {
48- "mocha" : " ^1.21.5 " ,
49+ "mocha" : " ^2.0.0 " ,
4950 "mocha-jshint" : " ^0.0.9" ,
5051 "istanbul" : " ^0.3.2" ,
5152 "coveralls" : " ^2.11.2"
Original file line number Diff line number Diff line change @@ -586,7 +586,7 @@ class ResizeWorker : public NanAsyncWorker {
586586 Handle<Value> argv[3 ] = { NanNull (), NanNull (), NanNull () };
587587 if (!baton->err .empty ()) {
588588 // Error
589- argv[0 ] = NanNew<String>(baton->err .data (), baton->err .size ());
589+ argv[0 ] = Exception::Error ( NanNew<String>(baton->err .data (), baton->err .size () ));
590590 } else {
591591 int width = baton->width ;
592592 int height = baton->height ;
Original file line number Diff line number Diff line change @@ -198,6 +198,15 @@ describe('Input/output', function() {
198198 done ( ) ;
199199 } ) ;
200200
201+ it ( 'Fail when input is invalid Buffer' , function ( done ) {
202+ sharp ( new Buffer ( [ 0x1 , 0x2 , 0x3 , 0x4 ] ) )
203+ . toBuffer ( function ( err ) {
204+ assert . ok ( err ) ;
205+ assert . ok ( err instanceof Error ) ;
206+ done ( ) ;
207+ } ) ;
208+ } ) ;
209+
201210 it ( 'Promises/A+' , function ( done ) {
202211 sharp ( fixtures . inputJpg ) . resize ( 320 , 240 ) . toBuffer ( ) . then ( function ( data ) {
203212 sharp ( data ) . toBuffer ( function ( err , data , info ) {
You can’t perform that action at this time.
0 commit comments