jimp 0.16.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/lib/jimp.js +18 -4
- package/browser/lib/jimp.min.js +1 -1
- package/package.json +6 -6
package/browser/lib/jimp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Jimp v0.
|
|
2
|
+
Jimp v0.16.0
|
|
3
3
|
https://github.com/oliver-moran/jimp
|
|
4
4
|
Ported for the Web by Phil Seaton
|
|
5
5
|
MIT License
|
|
@@ -20245,6 +20245,7 @@ var JpegImage = (function jpegImage() {
|
|
|
20245
20245
|
var quantizationTables = [], frames = [];
|
|
20246
20246
|
var huffmanTablesAC = [], huffmanTablesDC = [];
|
|
20247
20247
|
var fileMarker = readUint16();
|
|
20248
|
+
this.comments = [];
|
|
20248
20249
|
if (fileMarker != 0xFFD8) { // SOI (Start of Image)
|
|
20249
20250
|
throw new Error("SOI not found");
|
|
20250
20251
|
}
|
|
@@ -20273,6 +20274,11 @@ var JpegImage = (function jpegImage() {
|
|
|
20273
20274
|
case 0xFFFE: // COM (Comment)
|
|
20274
20275
|
var appData = readDataBlock();
|
|
20275
20276
|
|
|
20277
|
+
if (fileMarker === 0xFFFE) {
|
|
20278
|
+
var comment = String.fromCharCode.apply(null, appData);
|
|
20279
|
+
this.comments.push(comment);
|
|
20280
|
+
}
|
|
20281
|
+
|
|
20276
20282
|
if (fileMarker === 0xFFE0) {
|
|
20277
20283
|
if (appData[0] === 0x4A && appData[1] === 0x46 && appData[2] === 0x49 &&
|
|
20278
20284
|
appData[3] === 0x46 && appData[4] === 0) { // 'JFIF\x00'
|
|
@@ -20398,6 +20404,11 @@ var JpegImage = (function jpegImage() {
|
|
|
20398
20404
|
resetInterval = readUint16();
|
|
20399
20405
|
break;
|
|
20400
20406
|
|
|
20407
|
+
case 0xFFDC: // Number of Lines marker
|
|
20408
|
+
readUint16() // skip data length
|
|
20409
|
+
readUint16() // Ignore this data since it represents the image height
|
|
20410
|
+
break;
|
|
20411
|
+
|
|
20401
20412
|
case 0xFFDA: // SOS (Start of Scan)
|
|
20402
20413
|
var scanLength = readUint16();
|
|
20403
20414
|
var selectorsCount = data[offset++];
|
|
@@ -20716,8 +20727,11 @@ function decode(jpegData, userOpts = {}) {
|
|
|
20716
20727
|
exifBuffer: decoder.exifBuffer,
|
|
20717
20728
|
data: opts.useTArray ?
|
|
20718
20729
|
new Uint8Array(bytesNeeded) :
|
|
20719
|
-
|
|
20730
|
+
Buffer.alloc(bytesNeeded)
|
|
20720
20731
|
};
|
|
20732
|
+
if(decoder.comments.length > 0) {
|
|
20733
|
+
image["comments"] = decoder.comments;
|
|
20734
|
+
}
|
|
20721
20735
|
} catch (err){
|
|
20722
20736
|
if (err instanceof RangeError){
|
|
20723
20737
|
throw new Error("Could not allocate enough memory for the image. " +
|
|
@@ -20773,7 +20787,7 @@ Basic GUI blocking jpeg encoder
|
|
|
20773
20787
|
*/
|
|
20774
20788
|
|
|
20775
20789
|
var btoa = btoa || function(buf) {
|
|
20776
|
-
return
|
|
20790
|
+
return Buffer.from(buf).toString('base64');
|
|
20777
20791
|
};
|
|
20778
20792
|
|
|
20779
20793
|
function JPEGEncoder(quality) {
|
|
@@ -21451,7 +21465,7 @@ function JPEGEncoder(quality) {
|
|
|
21451
21465
|
writeWord(0xFFD9); //EOI
|
|
21452
21466
|
|
|
21453
21467
|
if (typeof module === 'undefined') return new Uint8Array(byteout);
|
|
21454
|
-
return
|
|
21468
|
+
return Buffer.from(byteout);
|
|
21455
21469
|
|
|
21456
21470
|
var jpegDataUri = 'data:image/jpeg;base64,' + btoa(byteout.join(''));
|
|
21457
21471
|
|
package/browser/lib/jimp.min.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jimp",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "An image processing library written entirely in JavaScript (i.e. zero external or native dependencies)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"license": "MIT",
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@babel/runtime": "^7.7.2",
|
|
62
|
-
"@jimp/custom": "^0.16.
|
|
63
|
-
"@jimp/plugins": "^0.16.
|
|
64
|
-
"@jimp/types": "^0.16.
|
|
62
|
+
"@jimp/custom": "^0.16.1",
|
|
63
|
+
"@jimp/plugins": "^0.16.1",
|
|
64
|
+
"@jimp/types": "^0.16.1",
|
|
65
65
|
"regenerator-runtime": "^0.13.3"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@babel/plugin-syntax-object-rest-spread": "^7.2.0",
|
|
72
72
|
"@babel/preset-env": "^7.7.1",
|
|
73
73
|
"@babel/register": "^7.7.0",
|
|
74
|
-
"@jimp/test-utils": "^0.16.
|
|
74
|
+
"@jimp/test-utils": "^0.16.1",
|
|
75
75
|
"babel-eslint": "^10.0.3",
|
|
76
76
|
"babel-plugin-add-module-exports": "^1.0.2",
|
|
77
77
|
"babel-plugin-istanbul": "^5.2.0",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"test/*.js"
|
|
117
117
|
]
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "909f06eac36ef5ba36ebb1e0853fd006c4da3560"
|
|
120
120
|
}
|