File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1100,7 +1100,7 @@ function decode(jpegData, userOpts = {}) {
1100
1100
exifBuffer : decoder . exifBuffer ,
1101
1101
data : opts . useTArray ?
1102
1102
new Uint8Array ( bytesNeeded ) :
1103
- new Buffer ( bytesNeeded )
1103
+ Buffer . alloc ( bytesNeeded )
1104
1104
} ;
1105
1105
if ( decoder . comments . length > 0 ) {
1106
1106
image [ "comments" ] = decoder . comments ;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ Basic GUI blocking jpeg encoder
36
36
*/
37
37
38
38
var btoa = btoa || function ( buf ) {
39
- return new Buffer ( buf ) . toString ( 'base64' ) ;
39
+ return Buffer . from ( buf ) . toString ( 'base64' ) ;
40
40
} ;
41
41
42
42
function JPEGEncoder ( quality ) {
@@ -714,7 +714,7 @@ function JPEGEncoder(quality) {
714
714
writeWord ( 0xFFD9 ) ; //EOI
715
715
716
716
if ( typeof module === 'undefined' ) return new Uint8Array ( byteout ) ;
717
- return new Buffer ( byteout ) ;
717
+ return Buffer . from ( byteout ) ;
718
718
719
719
var jpegDataUri = 'data:image/jpeg;base64,' + btoa ( byteout . join ( '' ) ) ;
720
720
You can’t perform that action at this time.
0 commit comments