@kensio/colophon 2.10.0 → 2.11.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/README.md +1 -1
- package/dist/cli/index.js +0 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -1
- package/dist/config/index.js.map +1 -1
- package/dist/encode/index.d.ts.map +1 -1
- package/dist/encode/index.js +10 -5
- package/dist/encode/index.js.map +1 -1
- package/dist/encode/quantise.d.ts +22 -0
- package/dist/encode/quantise.d.ts.map +1 -0
- package/dist/encode/quantise.js +29 -0
- package/dist/encode/quantise.js.map +1 -0
- package/dist/encode/sharp.d.ts +15 -0
- package/dist/encode/sharp.d.ts.map +1 -1
- package/dist/encode/sharp.js +20 -0
- package/dist/encode/sharp.js.map +1 -1
- package/dist/image/media.d.ts.map +1 -1
- package/dist/image/media.js.map +1 -1
- package/dist/image/svg.js +1 -1
- package/dist/platform/base64.d.ts.map +1 -1
- package/dist/platform/base64.js +0 -2
- package/dist/platform/base64.js.map +1 -1
- package/dist/png/carry.d.ts +27 -0
- package/dist/png/carry.d.ts.map +1 -0
- package/dist/png/carry.js +54 -0
- package/dist/png/carry.js.map +1 -0
- package/dist/png/index.d.ts +7 -5
- package/dist/png/index.d.ts.map +1 -1
- package/dist/png/index.js +1 -0
- package/dist/png/index.js.map +1 -1
- package/dist/pool.js +1 -1
- package/dist/stamp/config-digest.d.ts +4 -0
- package/dist/stamp/config-digest.d.ts.map +1 -1
- package/dist/stamp/config-digest.js +5 -0
- package/dist/stamp/config-digest.js.map +1 -1
- package/dist/texture/color.d.ts +10 -0
- package/dist/texture/color.d.ts.map +1 -0
- package/dist/texture/color.js +10 -0
- package/dist/texture/color.js.map +1 -0
- package/dist/texture/index.d.ts +2 -1
- package/dist/texture/index.d.ts.map +1 -1
- package/dist/texture/index.js +6 -1
- package/dist/texture/index.js.map +1 -1
- package/dist/texture/pattern.d.ts.map +1 -1
- package/dist/texture/pattern.js +1 -2
- package/dist/texture/pattern.js.map +1 -1
- package/dist/texture/resolve.d.ts +5 -4
- package/dist/texture/resolve.d.ts.map +1 -1
- package/dist/texture/resolve.js +5 -4
- package/dist/texture/resolve.js.map +1 -1
- package/dist/texture/waves.d.ts +18 -0
- package/dist/texture/waves.d.ts.map +1 -0
- package/dist/texture/waves.js +55 -0
- package/dist/texture/waves.js.map +1 -0
- package/dist/types.d.ts +51 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/validate/keys.d.ts +4 -2
- package/dist/validate/keys.d.ts.map +1 -1
- package/dist/validate/keys.js +12 -2
- package/dist/validate/keys.js.map +1 -1
- package/dist/validate/texture.d.ts.map +1 -1
- package/dist/validate/texture.js +5 -1
- package/dist/validate/texture.js.map +1 -1
- package/package.json +23 -24
- package/dist/highlight/probe.d.ts +0 -4
- package/dist/highlight/probe.d.ts.map +0 -1
- package/dist/highlight/probe.js +0 -4
- package/dist/highlight/probe.js.map +0 -1
- package/dist/jpeg/index.d.ts +0 -10
- package/dist/jpeg/index.d.ts.map +0 -1
- package/dist/jpeg/index.js +0 -2
- package/dist/jpeg/index.js.map +0 -1
- package/dist/render/png.d.ts +0 -20
- package/dist/render/png.d.ts.map +0 -1
- package/dist/render/png.js +0 -29
- package/dist/render/png.js.map +0 -1
- package/dist/stamp/chunk.d.ts +0 -14
- package/dist/stamp/chunk.d.ts.map +0 -1
- package/dist/stamp/chunk.js +0 -38
- package/dist/stamp/chunk.js.map +0 -1
- package/dist/templates/code/ellipsis.d.ts +0 -3
- package/dist/templates/code/ellipsis.d.ts.map +0 -1
- package/dist/templates/code/ellipsis.js +0 -3
- package/dist/templates/code/ellipsis.js.map +0 -1
package/dist/stamp/chunk.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { chunkBytes, pngSignature } from "../png/chunk.js";
|
|
2
|
-
/**
|
|
3
|
-
* PNG `tEXt` keyword the stamp is stored under. Keeping it in the image means
|
|
4
|
-
* there is no sidecar file to fall out of sync, and deleting an image deletes
|
|
5
|
-
* its stamp with it.
|
|
6
|
-
*/
|
|
7
|
-
export const stampKeyword = "colophon";
|
|
8
|
-
/** Signature + the whole `IHDR` chunk: length, type, 13 bytes of data, CRC. */
|
|
9
|
-
export const afterHeader = pngSignature.length + 4 + 4 + 13 + 4;
|
|
10
|
-
/** What a `tEXt` chunk carries: `keyword\0text`. */
|
|
11
|
-
function textData(keyword, text) {
|
|
12
|
-
return Buffer.concat([
|
|
13
|
-
Buffer.from(keyword, "latin1"),
|
|
14
|
-
Buffer.from([0]),
|
|
15
|
-
Buffer.from(text, "latin1"),
|
|
16
|
-
]);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Return `png` with the stamp embedded as a `tEXt` chunk, inserted straight
|
|
20
|
-
* after the header so it can be read back without decoding the image.
|
|
21
|
-
*/
|
|
22
|
-
export function stampPng(png, stamp) {
|
|
23
|
-
if (png.length < afterHeader ||
|
|
24
|
-
!png.subarray(0, pngSignature.length).equals(pngSignature) ||
|
|
25
|
-
png.toString("latin1", 12, 16) !== "IHDR") {
|
|
26
|
-
// Reachable in practice only through a configured rasteriser, since resvg
|
|
27
|
-
// writes nothing else. Saying why beats leaving someone to work out that
|
|
28
|
-
// the stamp is the reason their WebP backend cannot be used yet.
|
|
29
|
-
throw new Error("Cannot stamp: not a PNG image. The rebuild stamp is a PNG chunk, so a" +
|
|
30
|
-
" rasteriser has to produce PNG for a build to be able to skip it.");
|
|
31
|
-
}
|
|
32
|
-
return Buffer.concat([
|
|
33
|
-
png.subarray(0, afterHeader),
|
|
34
|
-
chunkBytes("tEXt", textData(stampKeyword, stamp)),
|
|
35
|
-
png.subarray(afterHeader),
|
|
36
|
-
]);
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=chunk.js.map
|
package/dist/stamp/chunk.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk.js","sourceRoot":"","sources":["../../src/stamp/chunk.ts"],"names":[],"mappings":"AAAA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-
{"version":3,"file":"ellipsis.d.ts","sourceRoot":"","sources":["../../../src/templates/code/ellipsis.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,eAAO,MAAM,QAAQ,WAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ellipsis.js","sourceRoot":"","sources":["../../../src/templates/code/ellipsis.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC"}
|