@cogeotiff/core 7.2.1 → 8.0.2

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.
Files changed (147) hide show
  1. package/CHANGELOG.md +5 -502
  2. package/README.md +23 -11
  3. package/build/__benchmark__/cog.read.benchmark.d.ts +0 -1
  4. package/build/__benchmark__/cog.read.benchmark.js +6 -4
  5. package/build/__benchmark__/cog.read.benchmark.js.map +1 -0
  6. package/build/__benchmark__/source.file.d.ts +9 -0
  7. package/build/__benchmark__/source.file.js +29 -0
  8. package/build/__benchmark__/source.file.js.map +1 -0
  9. package/build/__benchmark__/source.memory.d.ts +9 -0
  10. package/build/__benchmark__/source.memory.js +32 -0
  11. package/build/__benchmark__/source.memory.js.map +1 -0
  12. package/build/__test__/cog.image.test.d.ts +1 -2
  13. package/build/__test__/cog.image.test.js +82 -90
  14. package/build/__test__/cog.image.test.js.map +1 -0
  15. package/build/__test__/cog.read.test.d.ts +1 -2
  16. package/build/__test__/cog.read.test.js +37 -55
  17. package/build/__test__/cog.read.test.js.map +1 -0
  18. package/build/__test__/example.d.ts +1 -0
  19. package/build/__test__/example.js +27 -0
  20. package/build/__test__/example.js.map +1 -0
  21. package/build/cog.tiff.d.ts +22 -28
  22. package/build/cog.tiff.image.d.ts +11 -23
  23. package/build/cog.tiff.image.js +108 -62
  24. package/build/cog.tiff.image.js.map +1 -0
  25. package/build/cog.tiff.js +141 -97
  26. package/build/cog.tiff.js.map +1 -0
  27. package/build/const/index.d.ts +1 -2
  28. package/build/const/index.js +2 -2
  29. package/build/const/index.js.map +1 -0
  30. package/build/const/tiff.endian.d.ts +0 -1
  31. package/build/const/tiff.endian.js +1 -1
  32. package/build/const/tiff.endian.js.map +1 -0
  33. package/build/const/tiff.mime.d.ts +10 -11
  34. package/build/const/tiff.mime.js +22 -22
  35. package/build/const/tiff.mime.js.map +1 -0
  36. package/build/const/tiff.tag.id.d.ts +3 -3
  37. package/build/const/tiff.tag.id.js +4 -3
  38. package/build/const/tiff.tag.id.js.map +1 -0
  39. package/build/const/tiff.tag.value.d.ts +15 -16
  40. package/build/const/tiff.tag.value.js +16 -16
  41. package/build/const/tiff.tag.value.js.map +1 -0
  42. package/build/const/tiff.version.d.ts +0 -1
  43. package/build/const/tiff.version.js +1 -1
  44. package/build/const/tiff.version.js.map +1 -0
  45. package/build/index.d.ts +11 -6
  46. package/build/index.js +9 -5
  47. package/build/index.js.map +1 -0
  48. package/build/read/data.view.offset.d.ts +15 -0
  49. package/build/read/data.view.offset.js +19 -0
  50. package/build/read/data.view.offset.js.map +1 -0
  51. package/build/read/tiff.gdal.d.ts +9 -12
  52. package/build/read/tiff.gdal.js +22 -17
  53. package/build/read/tiff.gdal.js.map +1 -0
  54. package/build/read/tiff.ifd.config.d.ts +6 -4
  55. package/build/read/tiff.ifd.config.js +2 -2
  56. package/build/read/tiff.ifd.config.js.map +1 -0
  57. package/build/read/tiff.tag.d.ts +40 -20
  58. package/build/read/tiff.tag.factory.d.ts +16 -0
  59. package/build/read/tiff.tag.factory.js +130 -0
  60. package/build/read/tiff.tag.factory.js.map +1 -0
  61. package/build/read/tiff.tag.js +2 -37
  62. package/build/read/tiff.tag.js.map +1 -0
  63. package/build/read/tiff.value.reader.d.ts +2 -6
  64. package/build/read/tiff.value.reader.js +16 -54
  65. package/build/read/tiff.value.reader.js.map +1 -0
  66. package/build/source.d.ts +5 -0
  67. package/build/source.js +2 -0
  68. package/build/source.js.map +1 -0
  69. package/build/util/bytes.d.ts +17 -0
  70. package/build/util/bytes.js +42 -0
  71. package/build/util/bytes.js.map +1 -0
  72. package/build/util/util.hex.d.ts +2 -3
  73. package/build/util/util.hex.js +4 -5
  74. package/build/util/util.hex.js.map +1 -0
  75. package/build/vector.d.ts +0 -1
  76. package/build/vector.js +1 -1
  77. package/build/vector.js.map +1 -0
  78. package/package.json +25 -30
  79. package/src/__benchmark__/cog.read.benchmark.ts +12 -10
  80. package/src/__benchmark__/source.file.ts +23 -0
  81. package/src/__benchmark__/source.memory.ts +23 -0
  82. package/src/__test__/cog.image.test.ts +188 -197
  83. package/src/__test__/cog.read.test.ts +50 -72
  84. package/src/__test__/example.ts +31 -0
  85. package/src/cog.tiff.image.ts +456 -447
  86. package/src/cog.tiff.ts +142 -145
  87. package/src/const/index.ts +1 -1
  88. package/src/const/tiff.endian.ts +2 -2
  89. package/src/const/tiff.mime.ts +21 -21
  90. package/src/const/tiff.tag.id.ts +157 -156
  91. package/src/const/tiff.tag.value.ts +16 -16
  92. package/src/const/tiff.version.ts +11 -11
  93. package/src/index.ts +11 -5
  94. package/src/read/data.view.offset.ts +23 -0
  95. package/src/read/tiff.gdal.ts +61 -63
  96. package/src/read/tiff.ifd.config.ts +35 -31
  97. package/src/read/tiff.tag.factory.ts +163 -0
  98. package/src/read/tiff.tag.ts +40 -38
  99. package/src/read/tiff.value.reader.ts +25 -73
  100. package/src/source.ts +5 -0
  101. package/src/util/bytes.ts +44 -0
  102. package/src/util/util.hex.ts +5 -7
  103. package/src/vector.ts +5 -5
  104. package/tsconfig.json +8 -8
  105. package/build/__benchmark__/cog.read.benchmark.d.ts.map +0 -1
  106. package/build/__test__/cog.image.test.d.ts.map +0 -1
  107. package/build/__test__/cog.read.test.d.ts.map +0 -1
  108. package/build/cog.tiff.d.ts.map +0 -1
  109. package/build/cog.tiff.image.d.ts.map +0 -1
  110. package/build/const/index.d.ts.map +0 -1
  111. package/build/const/tiff.endian.d.ts.map +0 -1
  112. package/build/const/tiff.mime.d.ts.map +0 -1
  113. package/build/const/tiff.tag.id.d.ts.map +0 -1
  114. package/build/const/tiff.tag.value.d.ts.map +0 -1
  115. package/build/const/tiff.version.d.ts.map +0 -1
  116. package/build/index.d.ts.map +0 -1
  117. package/build/read/tag/__test__/tag.test.d.ts +0 -2
  118. package/build/read/tag/__test__/tag.test.d.ts.map +0 -1
  119. package/build/read/tag/__test__/tag.test.js +0 -23
  120. package/build/read/tag/tiff.tag.base.d.ts +0 -55
  121. package/build/read/tag/tiff.tag.base.d.ts.map +0 -1
  122. package/build/read/tag/tiff.tag.base.js +0 -79
  123. package/build/read/tag/tiff.tag.lazy.d.ts +0 -7
  124. package/build/read/tag/tiff.tag.lazy.d.ts.map +0 -1
  125. package/build/read/tag/tiff.tag.lazy.js +0 -18
  126. package/build/read/tag/tiff.tag.offset.d.ts +0 -21
  127. package/build/read/tag/tiff.tag.offset.d.ts.map +0 -1
  128. package/build/read/tag/tiff.tag.offset.js +0 -54
  129. package/build/read/tag/tiff.tag.static.d.ts +0 -8
  130. package/build/read/tag/tiff.tag.static.d.ts.map +0 -1
  131. package/build/read/tag/tiff.tag.static.js +0 -17
  132. package/build/read/tiff.gdal.d.ts.map +0 -1
  133. package/build/read/tiff.ifd.config.d.ts.map +0 -1
  134. package/build/read/tiff.tag.d.ts.map +0 -1
  135. package/build/read/tiff.value.reader.d.ts.map +0 -1
  136. package/build/source/cog.source.view.d.ts +0 -33
  137. package/build/source/cog.source.view.d.ts.map +0 -1
  138. package/build/source/cog.source.view.js +0 -65
  139. package/build/util/util.hex.d.ts.map +0 -1
  140. package/build/vector.d.ts.map +0 -1
  141. package/src/@types/ieee754.d.ts +0 -18
  142. package/src/read/tag/__test__/tag.test.ts +0 -27
  143. package/src/read/tag/tiff.tag.base.ts +0 -126
  144. package/src/read/tag/tiff.tag.lazy.ts +0 -17
  145. package/src/read/tag/tiff.tag.offset.ts +0 -61
  146. package/src/read/tag/tiff.tag.static.ts +0 -15
  147. 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
3
  import { TiffTag } from './const/tiff.tag.id.js';
5
4
  import { TiffVersion } from './const/tiff.version.js';
6
- import { CogTiffTagBase } from './read/tag/tiff.tag.base.js';
5
+ import { Tag } 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 { CogTiffTag } from './read/tiff.tag.js';
10
- import { CogSourceCursor } from './source/cog.source.view.js';
11
- import { toHexString } from './util/util.hex.js';
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
- source: ChunkSource;
15
- version = TiffVersion.Tiff;
16
- images: CogTiffImage[] = [];
17
- options = new CogTifGhostOptions();
18
-
19
- private cursor: CogSourceCursor;
20
- ifdConfig: TiffIfdConfig = TagTiffConfig;
21
-
22
- constructor(source: ChunkSource) {
23
- this.source = source;
24
- this.cursor = new CogSourceCursor(this);
25
- }
26
-
27
- /** Create and initialize a CogTiff */
28
- static create(source: ChunkSource): Promise<CogTiff> {
29
- return new CogTiff(source).init();
30
- }
31
-
32
- /** Has init() been called */
33
- isInitialized = false;
34
-
35
- _initPromise?: Promise<CogTiff>;
36
- /**
37
- * Initialize the COG loading in the header and all image headers
38
- *
39
- * @param loadGeoKeys Whether to also initialize the GeoKeyDirectory
40
- */
41
- init(loadGeoKeys = false): Promise<CogTiff> {
42
- if (this._initPromise) return this._initPromise;
43
- this._initPromise = this.doInit(loadGeoKeys);
44
- return this._initPromise;
45
- }
46
-
47
- private async doInit(loadGeoKeys = false): Promise<CogTiff> {
48
- if (this.isInitialized) return this;
49
- // Load the first few KB in, more loads will run as more data is required
50
- await this.source.loadBytes(0, this.source.chunkSize);
51
- await this.fetchIfd();
52
- await Promise.all(this.images.map((c) => c.init(loadGeoKeys)));
53
-
54
- this.isInitialized = true;
55
- return this;
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
- private async fetchIfd(): Promise<void> {
59
- const view = this.cursor.seekTo(0);
60
- const endian = view.uint16();
61
- this.source.isLittleEndian = endian === TiffEndian.Little;
62
- if (!this.source.isLittleEndian) throw new Error('Only little endian is supported');
63
- this.version = view.uint16();
64
-
65
- let nextOffsetIfd: number;
66
- if (this.version === TiffVersion.BigTiff) {
67
- this.ifdConfig = TagTiffBigConfig;
68
- const pointerSize = view.uint16();
69
- if (pointerSize !== 8) throw new Error('Only 8byte pointers are supported');
70
- const zeros = view.uint16();
71
- if (zeros !== 0) throw new Error('Invalid big tiff header');
72
- nextOffsetIfd = view.pointer();
73
- } else if (this.version === TiffVersion.Tiff) {
74
- nextOffsetIfd = view.pointer();
75
- } else {
76
- throw new Error(`Only tiff supported version:${this.version}`);
77
- }
78
-
79
- const ghostSize = nextOffsetIfd - this.cursor.currentOffset;
80
- // GDAL now stores metadata between the IFD inside a ghost storage area
81
- if (ghostSize > 0 && ghostSize < 16 * 1024) this.options.process(view.bytes(ghostSize));
82
-
83
- return this.processIfd(nextOffsetIfd);
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
- getImage(z: number): CogTiffImage {
87
- return this.images[z];
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
- * Find a image which has a resolution similar to the provided resolution
92
- *
93
- * @param resolution resolution to find
94
- */
95
- getImageByResolution(resolution: number): CogTiffImage {
96
- const firstImage = this.images[0];
97
- const firstImageSize = firstImage.size;
98
- const [refX] = firstImage.resolution;
99
-
100
- const resolutionBaseX = refX * firstImageSize.width;
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
- * Get the raw bytes for a tile at a given x,y, index.
117
- *
118
- * This may return null if the tile does not exist eg Sparse cogs,
119
- *
120
- * @param x tile x index
121
- * @param y tile y index
122
- * @param index image index
123
- */
124
- async getTile(x: number, y: number, index: number): Promise<{ mimeType: string; bytes: Uint8Array } | null> {
125
- const image = this.getImage(index);
126
- if (image == null) throw new Error(`Missing z: ${index}`);
127
- if (!image.isTiled()) throw new Error('Tif is not tiled');
128
-
129
- return image.getTile(x, y);
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<TiffTag, Tag> = 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
- private async processIfd(offset: number): Promise<void> {
133
- const { image, nextOffset } = await this.readIfd(offset);
134
- this.images.push(image);
135
-
136
- if (nextOffset) await this.processIfd(nextOffset);
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
- private async readIfd(offset: number): Promise<{ nextOffset: number; image: CogTiffImage }> {
140
- if (!this.source.hasBytes(offset, 4096)) await this.source.loadBytes(offset, 4096);
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
  }
@@ -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 { TiffTag as TiffTag, TiffTagGeo as TiffTagGeo } from './tiff.tag.id.js';
4
4
  export { TiffTagValueType } from './tiff.tag.value.js';
5
5
  export { TiffVersion } from './tiff.version.js';
@@ -3,6 +3,6 @@
3
3
  * The header of a tif file contains the endianness of the file
4
4
  */
5
5
  export enum TiffEndian {
6
- Big = 0x4d4d,
7
- Little = 0x4949,
6
+ Big = 0x4d4d,
7
+ Little = 0x4949,
8
8
  }
@@ -2,28 +2,28 @@
2
2
  * MimeType conversion for common tif image types
3
3
  */
4
4
  export enum TiffMimeType {
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
- LZERC = 'application/lerc',
14
- LZMA = 'application/x-lzma',
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
- 1: TiffMimeType.NONE,
19
- 5: TiffMimeType.LZW,
20
- 6: TiffMimeType.JPEG,
21
- 7: TiffMimeType.JPEG,
22
- 8: TiffMimeType.DEFLATE,
23
- 34887: TiffMimeType.LZERC,
24
- 34925: TiffMimeType.LZMA,
25
- 34712: TiffMimeType.JP2,
26
- 50000: TiffMimeType.ZSTD,
27
- 50001: TiffMimeType.WEBP,
28
- 50002: TiffMimeType.JPEGXL,
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
  };