@cogeotiff/core 7.2.0 → 8.0.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/CHANGELOG.md +3 -500
- package/README.md +28 -10
- package/build/__benchmark__/cog.read.benchmark.d.ts +0 -1
- package/build/__benchmark__/cog.read.benchmark.js +6 -4
- package/build/__benchmark__/cog.read.benchmark.js.map +1 -0
- package/build/__benchmark__/source.file.d.ts +9 -0
- package/build/__benchmark__/source.file.js +29 -0
- package/build/__benchmark__/source.file.js.map +1 -0
- package/build/__benchmark__/source.memory.d.ts +9 -0
- package/build/__benchmark__/source.memory.js +32 -0
- package/build/__benchmark__/source.memory.js.map +1 -0
- package/build/__test__/cog.image.test.d.ts +1 -2
- package/build/__test__/cog.image.test.js +82 -90
- package/build/__test__/cog.image.test.js.map +1 -0
- package/build/__test__/cog.read.test.d.ts +1 -2
- package/build/__test__/cog.read.test.js +37 -55
- package/build/__test__/cog.read.test.js.map +1 -0
- package/build/__test__/example.d.ts +1 -0
- package/build/__test__/example.js +27 -0
- package/build/__test__/example.js.map +1 -0
- package/build/cog.tiff.d.ts +22 -28
- package/build/cog.tiff.image.d.ts +16 -28
- package/build/cog.tiff.image.js +147 -101
- package/build/cog.tiff.image.js.map +1 -0
- package/build/cog.tiff.js +141 -97
- package/build/cog.tiff.js.map +1 -0
- package/build/const/index.d.ts +1 -2
- package/build/const/index.js +2 -2
- package/build/const/index.js.map +1 -0
- package/build/const/tiff.endian.d.ts +0 -1
- package/build/const/tiff.endian.js +1 -1
- package/build/const/tiff.endian.js.map +1 -0
- package/build/const/tiff.mime.d.ts +10 -11
- package/build/const/tiff.mime.js +22 -22
- package/build/const/tiff.mime.js.map +1 -0
- package/build/const/tiff.tag.id.d.ts +5 -5
- package/build/const/tiff.tag.id.js +155 -154
- package/build/const/tiff.tag.id.js.map +1 -0
- package/build/const/tiff.tag.value.d.ts +15 -16
- package/build/const/tiff.tag.value.js +16 -16
- package/build/const/tiff.tag.value.js.map +1 -0
- package/build/const/tiff.version.d.ts +0 -1
- package/build/const/tiff.version.js +1 -1
- package/build/const/tiff.version.js.map +1 -0
- package/build/index.d.ts +11 -6
- package/build/index.js +9 -5
- package/build/index.js.map +1 -0
- package/build/read/data.view.offset.d.ts +15 -0
- package/build/read/data.view.offset.js +19 -0
- package/build/read/data.view.offset.js.map +1 -0
- package/build/read/tiff.gdal.d.ts +9 -12
- package/build/read/tiff.gdal.js +22 -17
- package/build/read/tiff.gdal.js.map +1 -0
- package/build/read/tiff.ifd.config.d.ts +6 -4
- package/build/read/tiff.ifd.config.js +2 -2
- package/build/read/tiff.ifd.config.js.map +1 -0
- package/build/read/tiff.tag.d.ts +37 -20
- package/build/read/tiff.tag.factory.d.ts +16 -0
- package/build/read/tiff.tag.factory.js +130 -0
- package/build/read/tiff.tag.factory.js.map +1 -0
- package/build/read/tiff.tag.js +2 -37
- package/build/read/tiff.tag.js.map +1 -0
- package/build/read/tiff.value.reader.d.ts +2 -6
- package/build/read/tiff.value.reader.js +16 -54
- package/build/read/tiff.value.reader.js.map +1 -0
- package/build/source.d.ts +5 -0
- package/build/source.js +2 -0
- package/build/source.js.map +1 -0
- package/build/util/bytes.d.ts +17 -0
- package/build/util/bytes.js +42 -0
- package/build/util/bytes.js.map +1 -0
- package/build/util/util.hex.d.ts +2 -3
- package/build/util/util.hex.js +4 -5
- package/build/util/util.hex.js.map +1 -0
- package/build/vector.d.ts +0 -1
- package/build/vector.js +1 -1
- package/build/vector.js.map +1 -0
- package/package.json +25 -30
- package/src/__benchmark__/cog.read.benchmark.ts +12 -10
- package/src/__benchmark__/source.file.ts +23 -0
- package/src/__benchmark__/source.memory.ts +23 -0
- package/src/__test__/cog.image.test.ts +188 -197
- package/src/__test__/cog.read.test.ts +50 -72
- package/src/__test__/example.ts +31 -0
- package/src/cog.tiff.image.ts +456 -448
- package/src/cog.tiff.ts +143 -146
- package/src/const/index.ts +1 -1
- package/src/const/tiff.endian.ts +2 -2
- package/src/const/tiff.mime.ts +21 -21
- package/src/const/tiff.tag.id.ts +159 -158
- package/src/const/tiff.tag.value.ts +16 -16
- package/src/const/tiff.version.ts +11 -11
- package/src/index.ts +11 -5
- package/src/read/data.view.offset.ts +23 -0
- package/src/read/tiff.gdal.ts +61 -63
- package/src/read/tiff.ifd.config.ts +35 -31
- package/src/read/tiff.tag.factory.ts +163 -0
- package/src/read/tiff.tag.ts +38 -39
- package/src/read/tiff.value.reader.ts +25 -73
- package/src/source.ts +5 -0
- package/src/util/bytes.ts +44 -0
- package/src/util/util.hex.ts +5 -7
- package/src/vector.ts +5 -5
- package/tsconfig.json +8 -10
- package/build/__benchmark__/cog.read.benchmark.d.ts.map +0 -1
- package/build/__test__/cog.image.test.d.ts.map +0 -1
- package/build/__test__/cog.read.test.d.ts.map +0 -1
- package/build/cog.tiff.d.ts.map +0 -1
- package/build/cog.tiff.image.d.ts.map +0 -1
- package/build/const/index.d.ts.map +0 -1
- package/build/const/tiff.endian.d.ts.map +0 -1
- package/build/const/tiff.mime.d.ts.map +0 -1
- package/build/const/tiff.tag.id.d.ts.map +0 -1
- package/build/const/tiff.tag.value.d.ts.map +0 -1
- package/build/const/tiff.version.d.ts.map +0 -1
- package/build/index.d.ts.map +0 -1
- package/build/read/tag/__test__/tag.test.d.ts +0 -2
- package/build/read/tag/__test__/tag.test.d.ts.map +0 -1
- package/build/read/tag/__test__/tag.test.js +0 -23
- package/build/read/tag/tiff.tag.base.d.ts +0 -55
- package/build/read/tag/tiff.tag.base.d.ts.map +0 -1
- package/build/read/tag/tiff.tag.base.js +0 -79
- package/build/read/tag/tiff.tag.lazy.d.ts +0 -7
- package/build/read/tag/tiff.tag.lazy.d.ts.map +0 -1
- package/build/read/tag/tiff.tag.lazy.js +0 -18
- package/build/read/tag/tiff.tag.offset.d.ts +0 -21
- package/build/read/tag/tiff.tag.offset.d.ts.map +0 -1
- package/build/read/tag/tiff.tag.offset.js +0 -54
- package/build/read/tag/tiff.tag.static.d.ts +0 -8
- package/build/read/tag/tiff.tag.static.d.ts.map +0 -1
- package/build/read/tag/tiff.tag.static.js +0 -17
- package/build/read/tiff.gdal.d.ts.map +0 -1
- package/build/read/tiff.ifd.config.d.ts.map +0 -1
- package/build/read/tiff.tag.d.ts.map +0 -1
- package/build/read/tiff.value.reader.d.ts.map +0 -1
- package/build/source/cog.source.view.d.ts +0 -33
- package/build/source/cog.source.view.d.ts.map +0 -1
- package/build/source/cog.source.view.js +0 -65
- package/build/util/util.hex.d.ts.map +0 -1
- package/build/vector.d.ts.map +0 -1
- package/src/@types/ieee754.d.ts +0 -18
- package/src/read/tag/__test__/tag.test.ts +0 -27
- package/src/read/tag/tiff.tag.base.ts +0 -126
- package/src/read/tag/tiff.tag.lazy.ts +0 -17
- package/src/read/tag/tiff.tag.offset.ts +0 -61
- package/src/read/tag/tiff.tag.static.ts +0 -15
- package/src/source/cog.source.view.ts +0 -77
package/src/cog.tiff.ts
CHANGED
|
@@ -1,165 +1,162 @@
|
|
|
1
|
-
import { ChunkSource } from '@chunkd/core';
|
|
2
1
|
import { CogTiffImage } from './cog.tiff.image.js';
|
|
3
2
|
import { TiffEndian } from './const/tiff.endian.js';
|
|
4
|
-
import {
|
|
3
|
+
import { TagId } from './const/tiff.tag.id.js';
|
|
5
4
|
import { TiffVersion } from './const/tiff.version.js';
|
|
6
|
-
import {
|
|
5
|
+
import { TiffTag } from './index.js';
|
|
6
|
+
import { DataViewOffset, hasBytes } from './read/data.view.offset.js';
|
|
7
7
|
import { CogTifGhostOptions } from './read/tiff.gdal.js';
|
|
8
8
|
import { TagTiffBigConfig, TagTiffConfig, TiffIfdConfig } from './read/tiff.ifd.config.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { createTag } from './read/tiff.tag.factory.js';
|
|
10
|
+
import { Source } from './source.js';
|
|
11
|
+
import { getUint } from './util/bytes.js';
|
|
12
|
+
import { toHex } from './util/util.hex.js';
|
|
12
13
|
|
|
13
14
|
export class CogTiff {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
15
|
+
/** Read 16KB blocks at a time */
|
|
16
|
+
defaultReadSize = 16 * 1024;
|
|
17
|
+
/** Where this cog is fetching its data from */
|
|
18
|
+
source: Source;
|
|
19
|
+
/** Big or small Tiff */
|
|
20
|
+
version = TiffVersion.Tiff;
|
|
21
|
+
/** List of images, o is the base image */
|
|
22
|
+
images: CogTiffImage[] = [];
|
|
23
|
+
/** Ghost header options */
|
|
24
|
+
options?: CogTifGhostOptions;
|
|
25
|
+
/** Configuration for the size of the IFD */
|
|
26
|
+
ifdConfig: TiffIfdConfig = TagTiffConfig;
|
|
27
|
+
/** Is the tiff being read is little Endian */
|
|
28
|
+
isLittleEndian = false;
|
|
29
|
+
/** Has init() been called */
|
|
30
|
+
isInitialized = false;
|
|
31
|
+
|
|
32
|
+
private _initPromise?: Promise<CogTiff>;
|
|
33
|
+
constructor(source: Source) {
|
|
34
|
+
this.source = source;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Create a COG and initialize it by reading the COG headers */
|
|
38
|
+
static create(source: Source): Promise<CogTiff> {
|
|
39
|
+
return new CogTiff(source).init();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Initialize the COG loading in the header and all image headers
|
|
44
|
+
*/
|
|
45
|
+
init(): Promise<CogTiff> {
|
|
46
|
+
if (this._initPromise) return this._initPromise;
|
|
47
|
+
this._initPromise = this.readHeader();
|
|
48
|
+
return this._initPromise;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Find a image which has a resolution similar to the provided resolution
|
|
53
|
+
*
|
|
54
|
+
* @param resolution resolution to find
|
|
55
|
+
*/
|
|
56
|
+
getImageByResolution(resolution: number): CogTiffImage {
|
|
57
|
+
const firstImage = this.images[0];
|
|
58
|
+
const firstImageSize = firstImage.size;
|
|
59
|
+
const [refX] = firstImage.resolution;
|
|
60
|
+
|
|
61
|
+
const resolutionBaseX = refX * firstImageSize.width;
|
|
62
|
+
// const resolutionBaseY = refY * firstImageSize.height;
|
|
63
|
+
for (let i = this.images.length - 1; i > 0; i--) {
|
|
64
|
+
const img = this.images[i];
|
|
65
|
+
const imgSize = img.size;
|
|
66
|
+
|
|
67
|
+
const imgResolutionX = resolutionBaseX / imgSize.width;
|
|
68
|
+
// TODO do we care about y resolution
|
|
69
|
+
// const imgResolutionY = resolutionBaseY / imgSize.height;
|
|
70
|
+
|
|
71
|
+
if (imgResolutionX - resolution <= 0.01) return img;
|
|
56
72
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
return firstImage;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Read the Starting header and all Image headers from the source */
|
|
77
|
+
private async readHeader(): Promise<CogTiff> {
|
|
78
|
+
if (this.isInitialized) return this;
|
|
79
|
+
const bytes = new DataView(await this.source.fetch(0, this.defaultReadSize)) as DataViewOffset;
|
|
80
|
+
bytes.sourceOffset = 0;
|
|
81
|
+
|
|
82
|
+
let offset = 0;
|
|
83
|
+
const endian = bytes.getUint16(offset, this.isLittleEndian);
|
|
84
|
+
offset += 2;
|
|
85
|
+
|
|
86
|
+
this.isLittleEndian = endian === TiffEndian.Little;
|
|
87
|
+
if (!this.isLittleEndian) throw new Error('Only little endian is supported');
|
|
88
|
+
this.version = bytes.getUint16(offset, this.isLittleEndian);
|
|
89
|
+
offset += 2;
|
|
90
|
+
|
|
91
|
+
let nextOffsetIfd: number;
|
|
92
|
+
if (this.version === TiffVersion.BigTiff) {
|
|
93
|
+
this.ifdConfig = TagTiffBigConfig;
|
|
94
|
+
const pointerSize = bytes.getUint16(offset, this.isLittleEndian);
|
|
95
|
+
offset += 2;
|
|
96
|
+
if (pointerSize !== 8) throw new Error('Only 8byte pointers are supported');
|
|
97
|
+
const zeros = bytes.getUint16(offset, this.isLittleEndian);
|
|
98
|
+
offset += 2;
|
|
99
|
+
if (zeros !== 0) throw new Error('Invalid big tiff header');
|
|
100
|
+
nextOffsetIfd = getUint(bytes, offset, this.ifdConfig.pointer, this.isLittleEndian);
|
|
101
|
+
offset += this.ifdConfig.pointer;
|
|
102
|
+
} else if (this.version === TiffVersion.Tiff) {
|
|
103
|
+
nextOffsetIfd = getUint(bytes, offset, this.ifdConfig.pointer, this.isLittleEndian);
|
|
104
|
+
offset += this.ifdConfig.pointer;
|
|
105
|
+
} else {
|
|
106
|
+
throw new Error(`Only tiff supported version:${this.version}`);
|
|
84
107
|
}
|
|
85
108
|
|
|
86
|
-
|
|
87
|
-
|
|
109
|
+
const ghostSize = nextOffsetIfd - offset;
|
|
110
|
+
// GDAL now stores metadata between the IFD inside a ghost storage area
|
|
111
|
+
if (ghostSize > 0 && ghostSize < 16 * 1024) {
|
|
112
|
+
this.options = new CogTifGhostOptions();
|
|
113
|
+
this.options.process(bytes, offset, ghostSize);
|
|
88
114
|
}
|
|
89
115
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
// const resolutionBaseY = refY * firstImageSize.height;
|
|
102
|
-
for (let i = this.images.length - 1; i > 0; i--) {
|
|
103
|
-
const img = this.images[i];
|
|
104
|
-
const imgSize = img.size;
|
|
105
|
-
|
|
106
|
-
const imgResolutionX = resolutionBaseX / imgSize.width;
|
|
107
|
-
// TODO do we care about y resolution
|
|
108
|
-
// const imgResolutionY = resolutionBaseY / imgSize.height;
|
|
109
|
-
|
|
110
|
-
if (imgResolutionX - resolution <= 0.01) return img;
|
|
111
|
-
}
|
|
112
|
-
return firstImage;
|
|
116
|
+
while (nextOffsetIfd !== 0) {
|
|
117
|
+
let lastView = bytes;
|
|
118
|
+
|
|
119
|
+
// Ensure at least 1KB near at the IFD offset is ready for reading
|
|
120
|
+
// TODO is 1KB enough, most IFD entries are in the order of 100-300 bytes
|
|
121
|
+
if (!hasBytes(lastView, nextOffsetIfd, 1024)) {
|
|
122
|
+
const bytes = await this.source.fetch(nextOffsetIfd, this.defaultReadSize);
|
|
123
|
+
lastView = new DataView(bytes) as DataViewOffset;
|
|
124
|
+
lastView.sourceOffset = nextOffsetIfd;
|
|
125
|
+
}
|
|
126
|
+
nextOffsetIfd = await this.readIfd(nextOffsetIfd, lastView);
|
|
113
127
|
}
|
|
114
128
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
await Promise.all(this.images.map((i) => i.init()));
|
|
130
|
+
this.isInitialized = true;
|
|
131
|
+
return this;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Read a IFD at a the provided offset
|
|
136
|
+
*
|
|
137
|
+
* @param offset file offset to read the header from
|
|
138
|
+
* @param view offset that contains the bytes for the header
|
|
139
|
+
*/
|
|
140
|
+
private async readIfd(offset: number, view: DataViewOffset): Promise<number> {
|
|
141
|
+
const viewOffset = offset - view.sourceOffset;
|
|
142
|
+
const tagCount = getUint(view, viewOffset, this.ifdConfig.offset, this.isLittleEndian);
|
|
143
|
+
|
|
144
|
+
const tags: Map<TagId, TiffTag> = new Map();
|
|
145
|
+
|
|
146
|
+
// We now know how many bytes we need so ensure the ifd bytes are all read
|
|
147
|
+
const ifdBytes = tagCount * this.ifdConfig.ifd;
|
|
148
|
+
if (!hasBytes(view, offset, ifdBytes)) {
|
|
149
|
+
throw new Error('IFD out of range @ ' + toHex(offset) + ' IFD' + this.images.length);
|
|
130
150
|
}
|
|
131
151
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
152
|
+
const ifdSize = this.ifdConfig.ifd;
|
|
153
|
+
const startOffset = viewOffset + this.ifdConfig.offset;
|
|
154
|
+
for (let i = 0; i < tagCount; i++) {
|
|
155
|
+
const tag = createTag(this, view, startOffset + i * ifdSize);
|
|
156
|
+
tags.set(tag.id, tag);
|
|
137
157
|
}
|
|
138
158
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const view = this.cursor.seekTo(offset);
|
|
143
|
-
const tagCount = view.offset();
|
|
144
|
-
const byteStart = offset + this.ifdConfig.offset;
|
|
145
|
-
const tags: Map<TiffTag, CogTiffTagBase> = new Map();
|
|
146
|
-
|
|
147
|
-
let pos = byteStart;
|
|
148
|
-
for (let i = 0; i < tagCount; i++) {
|
|
149
|
-
const tag = CogTiffTag.create(this, pos);
|
|
150
|
-
pos += tag.size;
|
|
151
|
-
|
|
152
|
-
if (tag.name == null) throw new Error('Unknown IFD Tag: ' + toHexString(tag.id));
|
|
153
|
-
tags.set(tag.id, tag);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const image = new CogTiffImage(this, this.images.length, tags);
|
|
157
|
-
const nextOffset = this.source.getUint(pos, this.ifdConfig.pointer);
|
|
158
|
-
return { nextOffset, image };
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/** Close the file source if it needs closing */
|
|
162
|
-
async close(): Promise<void> {
|
|
163
|
-
await this.source?.close?.();
|
|
164
|
-
}
|
|
159
|
+
this.images.push(new CogTiffImage(this, this.images.length, tags));
|
|
160
|
+
return getUint(view, startOffset + tagCount * ifdSize, this.ifdConfig.pointer, this.isLittleEndian);
|
|
161
|
+
}
|
|
165
162
|
}
|
package/src/const/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { TiffEndian } from './tiff.endian.js';
|
|
2
2
|
export { TiffCompression, TiffMimeType } from './tiff.mime.js';
|
|
3
|
-
export { TiffTag, TiffTagGeo } from './tiff.tag.id.js';
|
|
3
|
+
export { TagId as TiffTag, TagGeoId as TiffTagGeo } from './tiff.tag.id.js';
|
|
4
4
|
export { TiffTagValueType } from './tiff.tag.value.js';
|
|
5
5
|
export { TiffVersion } from './tiff.version.js';
|
package/src/const/tiff.endian.ts
CHANGED
package/src/const/tiff.mime.ts
CHANGED
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
* MimeType conversion for common tif image types
|
|
3
3
|
*/
|
|
4
4
|
export enum TiffMimeType {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
None = 'application/octet-stream',
|
|
6
|
+
Jpeg = 'image/jpeg',
|
|
7
|
+
Jp2 = 'image/jp2',
|
|
8
|
+
JpegXl = 'image/jpegxl',
|
|
9
|
+
Webp = 'image/webp',
|
|
10
|
+
Zstd = 'application/zstd',
|
|
11
|
+
Lzw = 'application/lzw',
|
|
12
|
+
Deflate = 'application/deflate',
|
|
13
|
+
Lerc = 'application/lerc',
|
|
14
|
+
Lzma = 'application/x-lzma',
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const TiffCompression: { [key: number]: TiffMimeType } = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
1: TiffMimeType.None,
|
|
19
|
+
5: TiffMimeType.Lzw,
|
|
20
|
+
6: TiffMimeType.Jpeg,
|
|
21
|
+
7: TiffMimeType.Jpeg,
|
|
22
|
+
8: TiffMimeType.Deflate,
|
|
23
|
+
34887: TiffMimeType.Lerc,
|
|
24
|
+
34925: TiffMimeType.Lzma,
|
|
25
|
+
34712: TiffMimeType.Jp2,
|
|
26
|
+
50000: TiffMimeType.Zstd,
|
|
27
|
+
50001: TiffMimeType.Webp,
|
|
28
|
+
50002: TiffMimeType.JpegXl,
|
|
29
29
|
};
|