@podlite/publisher 0.0.43 → 0.0.44
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/CHANGELOG.podlite +4 -0
- package/esm/images-plugin.d.ts +1 -0
- package/esm/images-plugin.js +51 -0
- package/esm/images-plugin.js.map +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/lib/images-plugin.d.ts +1 -0
- package/lib/images-plugin.js +53 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.podlite
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
=head1 Upcoming
|
|
4
4
|
|
|
5
|
+
=head1 0.0.44
|
|
6
|
+
|
|
7
|
+
=item skip an image whose declared orientation is outside the range a build can read, instead of letting one such file stop the whole site
|
|
8
|
+
|
|
5
9
|
=head1 0.0.43
|
|
6
10
|
|
|
7
11
|
=item C<:language> on the index page reaches site data, so a site states the language of its own content
|
package/esm/images-plugin.d.ts
CHANGED
package/esm/images-plugin.js
CHANGED
|
@@ -3,6 +3,53 @@ import { ASSETS_PATH, IMAGE_LIB } from './constants';
|
|
|
3
3
|
import pathMod from 'path';
|
|
4
4
|
import * as fs from 'fs';
|
|
5
5
|
import { getPathToOpen } from './node-utils';
|
|
6
|
+
const ORIENTATION_TAG = 0x0112;
|
|
7
|
+
export const readOrientation = (file) => {
|
|
8
|
+
let bytes;
|
|
9
|
+
try {
|
|
10
|
+
bytes = fs.readFileSync(file);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
if (bytes.length < 4 || bytes.readUInt16BE(0) !== 0xffd8)
|
|
16
|
+
return null;
|
|
17
|
+
let at = 2;
|
|
18
|
+
while (at + 4 <= bytes.length) {
|
|
19
|
+
if (bytes[at] !== 0xff)
|
|
20
|
+
return null;
|
|
21
|
+
const marker = bytes.readUInt16BE(at);
|
|
22
|
+
const size = bytes.readUInt16BE(at + 2);
|
|
23
|
+
if (marker === 0xffe1 && bytes.toString('ascii', at + 4, at + 8) === 'Exif') {
|
|
24
|
+
const tiff = at + 10;
|
|
25
|
+
if (tiff + 8 > bytes.length)
|
|
26
|
+
return null;
|
|
27
|
+
const little = bytes.toString('ascii', tiff, tiff + 2) === 'II';
|
|
28
|
+
const u16 = (o) => (little ? bytes.readUInt16LE(o) : bytes.readUInt16BE(o));
|
|
29
|
+
const u32 = (o) => (little ? bytes.readUInt32LE(o) : bytes.readUInt32BE(o));
|
|
30
|
+
const dir = tiff + u32(tiff + 4);
|
|
31
|
+
if (dir + 2 > bytes.length)
|
|
32
|
+
return null;
|
|
33
|
+
const count = u16(dir);
|
|
34
|
+
for (let i = 0; i < count; i++) {
|
|
35
|
+
const entry = dir + 2 + i * 12;
|
|
36
|
+
if (entry + 12 > bytes.length)
|
|
37
|
+
return null;
|
|
38
|
+
if (u16(entry) === ORIENTATION_TAG)
|
|
39
|
+
return u16(entry + 8);
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
at += 2 + size;
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
};
|
|
47
|
+
// the build reads the orientation of every image it imports and stops on a value
|
|
48
|
+
// outside 1..8; one such file in a corpus used to cost the whole site
|
|
49
|
+
const isReadable = (file) => {
|
|
50
|
+
const orientation = readOrientation(file);
|
|
51
|
+
return orientation === null || (orientation >= 1 && orientation <= 8);
|
|
52
|
+
};
|
|
6
53
|
const plugin = () => {
|
|
7
54
|
const outCtx = {};
|
|
8
55
|
const imagesMap = new Map();
|
|
@@ -15,6 +62,10 @@ const plugin = () => {
|
|
|
15
62
|
if (!fs.existsSync(key)) {
|
|
16
63
|
continue;
|
|
17
64
|
}
|
|
65
|
+
if (!isReadable(key)) {
|
|
66
|
+
console.warn(`image skipped, its orientation is not a value the build can read: ${key}`);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
18
69
|
libFileContent += `import ${variable_name} from "${key}"
|
|
19
70
|
export { ${variable_name} }
|
|
20
71
|
`;
|
package/esm/images-plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images-plugin.js","sourceRoot":"","sources":["../src/images-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAW,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,OAAO,MAAM,MAAM,CAAA;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAG5C,MAAM,MAAM,GAAG,GAAqB,EAAE;IACpC,MAAM,MAAM,GAA4B,EAAE,CAAA;IAC1C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAE,CAAA;IAC3B,MAAM,MAAM,GAAG,GAAG,CAAC,EAAE;QACnB,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACjB,iBAAiB;YACjB,IAAI,cAAc,GAAG,EAAE,CAAA;YACvB,KAAK,MAAM,GAAG,IAAI,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;gBACnC,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;gBACxC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBACxB,SAAQ;gBACV,CAAC;gBACD,cAAc,IAAI,UAAU,aAAa,UAAU,GAAG;WACnD,aAAa;KACnB,CAAA;YACC,CAAC;YACD,cAAc,IAAI;;CAEvB,CAAA;YACK,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,CAAC,CAAA;QACrD,CAAC;QACD,OAAO,EAAE,GAAG,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,CA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CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACvC,CAAC,CAAA;IACD,MAAM,SAAS,GAAG,CAAC,IAAqB,EAAE,EAAE;QAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC1B,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;YAC9C,oCAAoC;YACpC,IAAI,KAAK,GAAG,EAA+B,CAAA;YAC3C,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBACrB,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;YAC9D,CAAC;YAED,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,CAAA;QACpC,CAAC,CAAC,CAAA;QACF,OAAO,GAAG,CAAA;IACZ,CAAC,CAAA;IAED,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;AAC5B,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
package/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.44";
|
package/esm/version.js
CHANGED
package/lib/images-plugin.d.ts
CHANGED
package/lib/images-plugin.js
CHANGED
|
@@ -36,11 +36,60 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.readOrientation = void 0;
|
|
39
40
|
const schema_1 = require("@podlite/schema");
|
|
40
41
|
const constants_1 = require("./constants");
|
|
41
42
|
const path_1 = __importDefault(require("path"));
|
|
42
43
|
const fs = __importStar(require("fs"));
|
|
43
44
|
const node_utils_1 = require("./node-utils");
|
|
45
|
+
const ORIENTATION_TAG = 0x0112;
|
|
46
|
+
const readOrientation = (file) => {
|
|
47
|
+
let bytes;
|
|
48
|
+
try {
|
|
49
|
+
bytes = fs.readFileSync(file);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
if (bytes.length < 4 || bytes.readUInt16BE(0) !== 0xffd8)
|
|
55
|
+
return null;
|
|
56
|
+
let at = 2;
|
|
57
|
+
while (at + 4 <= bytes.length) {
|
|
58
|
+
if (bytes[at] !== 0xff)
|
|
59
|
+
return null;
|
|
60
|
+
const marker = bytes.readUInt16BE(at);
|
|
61
|
+
const size = bytes.readUInt16BE(at + 2);
|
|
62
|
+
if (marker === 0xffe1 && bytes.toString('ascii', at + 4, at + 8) === 'Exif') {
|
|
63
|
+
const tiff = at + 10;
|
|
64
|
+
if (tiff + 8 > bytes.length)
|
|
65
|
+
return null;
|
|
66
|
+
const little = bytes.toString('ascii', tiff, tiff + 2) === 'II';
|
|
67
|
+
const u16 = (o) => (little ? bytes.readUInt16LE(o) : bytes.readUInt16BE(o));
|
|
68
|
+
const u32 = (o) => (little ? bytes.readUInt32LE(o) : bytes.readUInt32BE(o));
|
|
69
|
+
const dir = tiff + u32(tiff + 4);
|
|
70
|
+
if (dir + 2 > bytes.length)
|
|
71
|
+
return null;
|
|
72
|
+
const count = u16(dir);
|
|
73
|
+
for (let i = 0; i < count; i++) {
|
|
74
|
+
const entry = dir + 2 + i * 12;
|
|
75
|
+
if (entry + 12 > bytes.length)
|
|
76
|
+
return null;
|
|
77
|
+
if (u16(entry) === ORIENTATION_TAG)
|
|
78
|
+
return u16(entry + 8);
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
at += 2 + size;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
};
|
|
86
|
+
exports.readOrientation = readOrientation;
|
|
87
|
+
// the build reads the orientation of every image it imports and stops on a value
|
|
88
|
+
// outside 1..8; one such file in a corpus used to cost the whole site
|
|
89
|
+
const isReadable = (file) => {
|
|
90
|
+
const orientation = (0, exports.readOrientation)(file);
|
|
91
|
+
return orientation === null || (orientation >= 1 && orientation <= 8);
|
|
92
|
+
};
|
|
44
93
|
const plugin = () => {
|
|
45
94
|
const outCtx = {};
|
|
46
95
|
const imagesMap = new Map();
|
|
@@ -53,6 +102,10 @@ const plugin = () => {
|
|
|
53
102
|
if (!fs.existsSync(key)) {
|
|
54
103
|
continue;
|
|
55
104
|
}
|
|
105
|
+
if (!isReadable(key)) {
|
|
106
|
+
console.warn(`image skipped, its orientation is not a value the build can read: ${key}`);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
56
109
|
libFileContent += `import ${variable_name} from "${key}"
|
|
57
110
|
export { ${variable_name} }
|
|
58
111
|
`;
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.44";
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@podlite/publisher",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"description": "Publishing toolkit for Podlite — transform documents to HTML, generate sites",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
"transform"
|
|
67
67
|
],
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@podlite/markdown": "0.0.
|
|
70
|
-
"@podlite/schema": "0.0.
|
|
69
|
+
"@podlite/markdown": "0.0.56",
|
|
70
|
+
"@podlite/schema": "0.0.63",
|
|
71
71
|
"crc-32": "^1.2.2",
|
|
72
72
|
"gray-matter": "^4.0.3",
|
|
73
73
|
"iso_9": "^1.0.4",
|
|
74
74
|
"newbase60": "^1.3.1",
|
|
75
|
-
"podlite": "0.0.
|
|
75
|
+
"podlite": "0.0.76"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@types/node": "^17.0.7",
|