@d0paminedriven/fs 7.4.0 → 7.6.0
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/dist/{chunk-XCA34DKZ.js → chunk-3RC3WC7A.js} +2 -2
- package/dist/{chunk-IU4MDHYM.js → chunk-4LZQHSBL.js} +15 -13
- package/dist/chunk-6R36YN3W.js +386 -0
- package/dist/{chunk-KDWGS5GC.js → chunk-CTSJFQMC.js} +2 -2
- package/dist/{chunk-7FHBNIB7.js → chunk-I4ITMOIV.js} +2 -2
- package/dist/{chunk-Q2VF3BVH.js → chunk-MUFEXR25.js} +2 -2
- package/dist/{chunk-KNLXF622.js → chunk-PHTZ7NRL.js} +26 -6
- package/dist/{chunk-R63XI7FS.js → chunk-Q6QZ5XEP.js} +1 -1
- package/dist/{chunk-TDMPLELZ.js → chunk-QKZIGBLD.js} +2 -2
- package/dist/chunk-TUY7Y4DL.js +1335 -0
- package/dist/{chunk-FPB77OGJ.js → chunk-ZQRB46YA.js} +3 -3
- package/dist/fs/index.d.ts +133 -1
- package/dist/fs/index.js +11 -10
- package/dist/fs-atomic/index.d.ts +1 -0
- package/dist/fs-atomic/index.js +5 -4
- package/dist/fs-base/index.d.ts +1 -0
- package/dist/fs-base/index.js +4 -3
- package/dist/fs-core/index.d.ts +2 -1
- package/dist/fs-core/index.js +8 -7
- package/dist/fs-fetch/index.d.ts +4 -3
- package/dist/fs-fetch/index.js +10 -9
- package/dist/fs-size/index.d.ts +1 -0
- package/dist/fs-size/index.js +7 -6
- package/dist/fs-tmp/index.d.ts +1 -0
- package/dist/fs-tmp/index.js +9 -8
- package/dist/image/index.d.ts +340 -21
- package/dist/image/index.js +3 -2
- package/dist/image/workup.d.ts +39 -0
- package/dist/image/workup.js +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -10
- package/dist/mime/index.d.ts +45 -15
- package/dist/mime/index.js +1 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.js +1 -1
- package/package.json +13 -8
- package/dist/chunk-C2ANVZLG.js +0 -918
package/dist/image/index.d.ts
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import { ImageSpecs } from '../types/index.js';
|
|
2
|
-
import { MimeService } from '../mime/index.js';
|
|
3
1
|
import { Readable } from 'node:stream';
|
|
2
|
+
import { ImageSpecs } from '../types/index.js';
|
|
3
|
+
import { ImageServiceWorkup } from './workup.js';
|
|
4
4
|
import 'stream';
|
|
5
5
|
import 'buffer';
|
|
6
|
+
import '../mime/index.js';
|
|
6
7
|
import '../url/index.js';
|
|
7
8
|
import '../utils/index.js';
|
|
8
9
|
import '../ld/index.js';
|
|
9
10
|
|
|
10
|
-
declare class ImageService extends
|
|
11
|
+
declare class ImageService extends ImageServiceWorkup {
|
|
11
12
|
cwd: string;
|
|
12
13
|
constructor(cwd: string);
|
|
13
|
-
/**
|
|
14
|
-
* Read exactly N bytes from a stream, returning a Buffer
|
|
15
|
-
* Closes stream after reading or on error
|
|
16
|
-
*/
|
|
17
|
-
private readBytes;
|
|
18
14
|
/**
|
|
19
15
|
* Extract image metadata from a stream, reading only ~4KB for most formats
|
|
20
16
|
* Automatically handles PNG, JPEG, GIF, BMP, WebP, and AVIF
|
|
@@ -36,24 +32,290 @@ declare class ImageService extends MimeService {
|
|
|
36
32
|
private extractBMPFromBuffer;
|
|
37
33
|
private extractWebPFromBuffer;
|
|
38
34
|
private extractAVIFFromBuffer;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
extractViaStream(stream: Readable, size?: number): Promise<{
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
format: "apng" | "png";
|
|
39
|
+
frames: number;
|
|
40
|
+
animated: boolean;
|
|
41
|
+
hasAlpha: boolean;
|
|
42
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed";
|
|
43
|
+
orientation: null;
|
|
44
|
+
aspectRatio: number;
|
|
45
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
46
|
+
iccProfile: string | null;
|
|
47
|
+
exifDateTimeOriginal: string | null;
|
|
48
|
+
} | {
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
format: "jpeg";
|
|
52
|
+
frames: number;
|
|
53
|
+
animated: false;
|
|
54
|
+
hasAlpha: false;
|
|
55
|
+
orientation: number | null;
|
|
56
|
+
aspectRatio: number;
|
|
57
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
58
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
59
|
+
iccProfile: string | null;
|
|
60
|
+
exifDateTimeOriginal: string | null;
|
|
61
|
+
} | {
|
|
62
|
+
width: number;
|
|
63
|
+
height: number;
|
|
64
|
+
format: "gif";
|
|
65
|
+
frames: number;
|
|
66
|
+
animated: boolean;
|
|
67
|
+
hasAlpha: null;
|
|
68
|
+
orientation: null;
|
|
69
|
+
aspectRatio: number;
|
|
70
|
+
colorModel: "indexed";
|
|
71
|
+
colorSpace: "unknown";
|
|
72
|
+
iccProfile: null;
|
|
73
|
+
exifDateTimeOriginal: null;
|
|
74
|
+
} | {
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
format: "bmp";
|
|
78
|
+
frames: number;
|
|
79
|
+
animated: false;
|
|
80
|
+
hasAlpha: null;
|
|
81
|
+
orientation: number;
|
|
82
|
+
aspectRatio: number;
|
|
83
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
84
|
+
colorSpace: "unknown";
|
|
85
|
+
iccProfile: null;
|
|
86
|
+
exifDateTimeOriginal: null;
|
|
87
|
+
} | {
|
|
88
|
+
width: number;
|
|
89
|
+
height: number;
|
|
90
|
+
format: "webp";
|
|
91
|
+
frames: number;
|
|
92
|
+
animated: boolean;
|
|
93
|
+
hasAlpha: boolean;
|
|
94
|
+
colorModel: "unknown" | "rgb" | "rgba";
|
|
95
|
+
orientation: null;
|
|
96
|
+
aspectRatio: number;
|
|
97
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
98
|
+
iccProfile: string | null;
|
|
99
|
+
exifDateTimeOriginal: null;
|
|
100
|
+
} | {
|
|
101
|
+
width: number;
|
|
102
|
+
height: number;
|
|
103
|
+
format: "avif";
|
|
104
|
+
frames: number;
|
|
105
|
+
animated: boolean;
|
|
106
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
107
|
+
hasAlpha: true | null;
|
|
108
|
+
orientation: null;
|
|
109
|
+
aspectRatio: number;
|
|
110
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
111
|
+
iccProfile: string | null;
|
|
112
|
+
exifDateTimeOriginal: string | null;
|
|
113
|
+
} | {
|
|
114
|
+
width: number;
|
|
115
|
+
height: number;
|
|
116
|
+
format: "heic";
|
|
117
|
+
frames: number;
|
|
118
|
+
animated: boolean;
|
|
119
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
120
|
+
hasAlpha: true | null;
|
|
121
|
+
orientation: null;
|
|
122
|
+
aspectRatio: number;
|
|
123
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
124
|
+
iccProfile: string | null;
|
|
125
|
+
exifDateTimeOriginal: string | null;
|
|
126
|
+
} | {
|
|
127
|
+
width: number;
|
|
128
|
+
height: number;
|
|
129
|
+
format: "svg";
|
|
130
|
+
frames: number;
|
|
131
|
+
animated: boolean;
|
|
132
|
+
hasAlpha: true;
|
|
133
|
+
orientation: null;
|
|
134
|
+
aspectRatio: number;
|
|
135
|
+
colorModel: "vector";
|
|
136
|
+
colorSpace: "srgb";
|
|
137
|
+
iccProfile: null;
|
|
138
|
+
exifDateTimeOriginal: null;
|
|
139
|
+
} | {
|
|
140
|
+
width: number;
|
|
141
|
+
height: number;
|
|
142
|
+
format: "ico";
|
|
143
|
+
frames: number;
|
|
144
|
+
animated: false;
|
|
145
|
+
hasAlpha: true | null;
|
|
146
|
+
orientation: null;
|
|
147
|
+
aspectRatio: number;
|
|
148
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
149
|
+
colorSpace: "srgb";
|
|
150
|
+
iccProfile: null;
|
|
151
|
+
exifDateTimeOriginal: null;
|
|
152
|
+
} | {
|
|
153
|
+
width: number;
|
|
154
|
+
height: number;
|
|
155
|
+
format: "tiff";
|
|
156
|
+
frames: number;
|
|
157
|
+
animated: false;
|
|
158
|
+
hasAlpha: boolean;
|
|
159
|
+
orientation: number | null;
|
|
160
|
+
aspectRatio: number;
|
|
161
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
162
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
163
|
+
iccProfile: string | null;
|
|
164
|
+
exifDateTimeOriginal: string | null;
|
|
165
|
+
}>;
|
|
166
|
+
extractViaPath(filePath: string, size?: number): Promise<{
|
|
167
|
+
width: number;
|
|
168
|
+
height: number;
|
|
169
|
+
format: "apng" | "png";
|
|
170
|
+
frames: number;
|
|
171
|
+
animated: boolean;
|
|
172
|
+
hasAlpha: boolean;
|
|
173
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed";
|
|
174
|
+
orientation: null;
|
|
175
|
+
aspectRatio: number;
|
|
176
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
177
|
+
iccProfile: string | null;
|
|
178
|
+
exifDateTimeOriginal: string | null;
|
|
179
|
+
} | {
|
|
180
|
+
width: number;
|
|
181
|
+
height: number;
|
|
182
|
+
format: "jpeg";
|
|
183
|
+
frames: number;
|
|
184
|
+
animated: false;
|
|
185
|
+
hasAlpha: false;
|
|
186
|
+
orientation: number | null;
|
|
187
|
+
aspectRatio: number;
|
|
188
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
189
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
190
|
+
iccProfile: string | null;
|
|
191
|
+
exifDateTimeOriginal: string | null;
|
|
192
|
+
} | {
|
|
193
|
+
width: number;
|
|
194
|
+
height: number;
|
|
195
|
+
format: "gif";
|
|
196
|
+
frames: number;
|
|
197
|
+
animated: boolean;
|
|
198
|
+
hasAlpha: null;
|
|
199
|
+
orientation: null;
|
|
200
|
+
aspectRatio: number;
|
|
201
|
+
colorModel: "indexed";
|
|
202
|
+
colorSpace: "unknown";
|
|
203
|
+
iccProfile: null;
|
|
204
|
+
exifDateTimeOriginal: null;
|
|
205
|
+
} | {
|
|
206
|
+
width: number;
|
|
207
|
+
height: number;
|
|
208
|
+
format: "bmp";
|
|
209
|
+
frames: number;
|
|
210
|
+
animated: false;
|
|
211
|
+
hasAlpha: null;
|
|
212
|
+
orientation: number;
|
|
213
|
+
aspectRatio: number;
|
|
214
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
215
|
+
colorSpace: "unknown";
|
|
216
|
+
iccProfile: null;
|
|
217
|
+
exifDateTimeOriginal: null;
|
|
218
|
+
} | {
|
|
219
|
+
width: number;
|
|
220
|
+
height: number;
|
|
221
|
+
format: "webp";
|
|
222
|
+
frames: number;
|
|
223
|
+
animated: boolean;
|
|
224
|
+
hasAlpha: boolean;
|
|
225
|
+
colorModel: "unknown" | "rgb" | "rgba";
|
|
226
|
+
orientation: null;
|
|
227
|
+
aspectRatio: number;
|
|
228
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
229
|
+
iccProfile: string | null;
|
|
230
|
+
exifDateTimeOriginal: null;
|
|
231
|
+
} | {
|
|
232
|
+
width: number;
|
|
233
|
+
height: number;
|
|
234
|
+
format: "avif";
|
|
235
|
+
frames: number;
|
|
236
|
+
animated: boolean;
|
|
237
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
238
|
+
hasAlpha: true | null;
|
|
239
|
+
orientation: null;
|
|
240
|
+
aspectRatio: number;
|
|
241
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
242
|
+
iccProfile: string | null;
|
|
243
|
+
exifDateTimeOriginal: string | null;
|
|
244
|
+
} | {
|
|
245
|
+
width: number;
|
|
246
|
+
height: number;
|
|
247
|
+
format: "heic";
|
|
248
|
+
frames: number;
|
|
249
|
+
animated: boolean;
|
|
250
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
251
|
+
hasAlpha: true | null;
|
|
252
|
+
orientation: null;
|
|
253
|
+
aspectRatio: number;
|
|
254
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
255
|
+
iccProfile: string | null;
|
|
256
|
+
exifDateTimeOriginal: string | null;
|
|
257
|
+
} | {
|
|
258
|
+
width: number;
|
|
259
|
+
height: number;
|
|
260
|
+
format: "svg";
|
|
261
|
+
frames: number;
|
|
262
|
+
animated: boolean;
|
|
263
|
+
hasAlpha: true;
|
|
264
|
+
orientation: null;
|
|
265
|
+
aspectRatio: number;
|
|
266
|
+
colorModel: "vector";
|
|
267
|
+
colorSpace: "srgb";
|
|
268
|
+
iccProfile: null;
|
|
269
|
+
exifDateTimeOriginal: null;
|
|
270
|
+
} | {
|
|
271
|
+
width: number;
|
|
272
|
+
height: number;
|
|
273
|
+
format: "ico";
|
|
274
|
+
frames: number;
|
|
275
|
+
animated: false;
|
|
276
|
+
hasAlpha: true | null;
|
|
277
|
+
orientation: null;
|
|
278
|
+
aspectRatio: number;
|
|
279
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
280
|
+
colorSpace: "srgb";
|
|
281
|
+
iccProfile: null;
|
|
282
|
+
exifDateTimeOriginal: null;
|
|
283
|
+
} | {
|
|
284
|
+
width: number;
|
|
285
|
+
height: number;
|
|
286
|
+
format: "tiff";
|
|
287
|
+
frames: number;
|
|
288
|
+
animated: false;
|
|
289
|
+
hasAlpha: boolean;
|
|
290
|
+
orientation: number | null;
|
|
291
|
+
aspectRatio: number;
|
|
292
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
293
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
294
|
+
iccProfile: string | null;
|
|
295
|
+
exifDateTimeOriginal: string | null;
|
|
296
|
+
}>;
|
|
297
|
+
/**
|
|
298
|
+
* Probe image from various sources
|
|
299
|
+
* Handles local Buffer, remote URL, or S3 object
|
|
300
|
+
*/
|
|
301
|
+
extractRemote(source: Buffer | string, size?: number, timeout?: number): Promise<ImageSpecs>;
|
|
43
302
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
303
|
+
* Fetch minimal bytes from remote URL using Range header
|
|
304
|
+
* This is the KEY optimization - only fetch what we need!
|
|
46
305
|
*/
|
|
306
|
+
private knownToBlock;
|
|
307
|
+
private fetchMinimalBuffer;
|
|
47
308
|
getImageSpecsWorkup(rawbuffer: Buffer<ArrayBufferLike>, size?: number): {
|
|
48
309
|
width: number;
|
|
49
310
|
height: number;
|
|
50
|
-
format: "png";
|
|
311
|
+
format: "apng" | "png";
|
|
51
312
|
frames: number;
|
|
52
313
|
animated: boolean;
|
|
53
314
|
hasAlpha: boolean;
|
|
315
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed";
|
|
54
316
|
orientation: null;
|
|
55
317
|
aspectRatio: number;
|
|
56
|
-
colorSpace: "unknown" | "
|
|
318
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
57
319
|
iccProfile: string | null;
|
|
58
320
|
exifDateTimeOriginal: string | null;
|
|
59
321
|
} | {
|
|
@@ -65,7 +327,8 @@ declare class ImageService extends MimeService {
|
|
|
65
327
|
hasAlpha: false;
|
|
66
328
|
orientation: number | null;
|
|
67
329
|
aspectRatio: number;
|
|
68
|
-
colorSpace: "unknown" | "
|
|
330
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
331
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
69
332
|
iccProfile: string | null;
|
|
70
333
|
exifDateTimeOriginal: string | null;
|
|
71
334
|
} | {
|
|
@@ -77,7 +340,8 @@ declare class ImageService extends MimeService {
|
|
|
77
340
|
hasAlpha: null;
|
|
78
341
|
orientation: null;
|
|
79
342
|
aspectRatio: number;
|
|
80
|
-
|
|
343
|
+
colorModel: "indexed";
|
|
344
|
+
colorSpace: "unknown";
|
|
81
345
|
iccProfile: null;
|
|
82
346
|
exifDateTimeOriginal: null;
|
|
83
347
|
} | {
|
|
@@ -89,7 +353,8 @@ declare class ImageService extends MimeService {
|
|
|
89
353
|
hasAlpha: null;
|
|
90
354
|
orientation: number;
|
|
91
355
|
aspectRatio: number;
|
|
92
|
-
|
|
356
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
357
|
+
colorSpace: "unknown";
|
|
93
358
|
iccProfile: null;
|
|
94
359
|
exifDateTimeOriginal: null;
|
|
95
360
|
} | {
|
|
@@ -99,9 +364,10 @@ declare class ImageService extends MimeService {
|
|
|
99
364
|
frames: number;
|
|
100
365
|
animated: boolean;
|
|
101
366
|
hasAlpha: boolean;
|
|
367
|
+
colorModel: "unknown" | "rgb" | "rgba";
|
|
102
368
|
orientation: null;
|
|
103
369
|
aspectRatio: number;
|
|
104
|
-
colorSpace: "unknown" | "
|
|
370
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
105
371
|
iccProfile: string | null;
|
|
106
372
|
exifDateTimeOriginal: null;
|
|
107
373
|
} | {
|
|
@@ -110,10 +376,63 @@ declare class ImageService extends MimeService {
|
|
|
110
376
|
format: "avif";
|
|
111
377
|
frames: number;
|
|
112
378
|
animated: boolean;
|
|
379
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
380
|
+
hasAlpha: true | null;
|
|
381
|
+
orientation: null;
|
|
382
|
+
aspectRatio: number;
|
|
383
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
384
|
+
iccProfile: string | null;
|
|
385
|
+
exifDateTimeOriginal: string | null;
|
|
386
|
+
} | {
|
|
387
|
+
width: number;
|
|
388
|
+
height: number;
|
|
389
|
+
format: "heic";
|
|
390
|
+
frames: number;
|
|
391
|
+
animated: boolean;
|
|
392
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
113
393
|
hasAlpha: true | null;
|
|
114
394
|
orientation: null;
|
|
115
395
|
aspectRatio: number;
|
|
116
|
-
colorSpace: "unknown" | "
|
|
396
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
397
|
+
iccProfile: string | null;
|
|
398
|
+
exifDateTimeOriginal: string | null;
|
|
399
|
+
} | {
|
|
400
|
+
width: number;
|
|
401
|
+
height: number;
|
|
402
|
+
format: "svg";
|
|
403
|
+
frames: number;
|
|
404
|
+
animated: boolean;
|
|
405
|
+
hasAlpha: true;
|
|
406
|
+
orientation: null;
|
|
407
|
+
aspectRatio: number;
|
|
408
|
+
colorModel: "vector";
|
|
409
|
+
colorSpace: "srgb";
|
|
410
|
+
iccProfile: null;
|
|
411
|
+
exifDateTimeOriginal: null;
|
|
412
|
+
} | {
|
|
413
|
+
width: number;
|
|
414
|
+
height: number;
|
|
415
|
+
format: "ico";
|
|
416
|
+
frames: number;
|
|
417
|
+
animated: false;
|
|
418
|
+
hasAlpha: true | null;
|
|
419
|
+
orientation: null;
|
|
420
|
+
aspectRatio: number;
|
|
421
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
422
|
+
colorSpace: "srgb";
|
|
423
|
+
iccProfile: null;
|
|
424
|
+
exifDateTimeOriginal: null;
|
|
425
|
+
} | {
|
|
426
|
+
width: number;
|
|
427
|
+
height: number;
|
|
428
|
+
format: "tiff";
|
|
429
|
+
frames: number;
|
|
430
|
+
animated: false;
|
|
431
|
+
hasAlpha: boolean;
|
|
432
|
+
orientation: number | null;
|
|
433
|
+
aspectRatio: number;
|
|
434
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
|
|
435
|
+
colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
117
436
|
iccProfile: string | null;
|
|
118
437
|
exifDateTimeOriginal: string | null;
|
|
119
438
|
};
|
package/dist/image/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImageService
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-TUY7Y4DL.js";
|
|
4
|
+
import "../chunk-6R36YN3W.js";
|
|
5
|
+
import "../chunk-PHTZ7NRL.js";
|
|
5
6
|
import "../chunk-UW52DMHT.js";
|
|
6
7
|
import "../chunk-6HHKXBIM.js";
|
|
7
8
|
import "../chunk-Z2WZLZC4.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Readable } from 'stream';
|
|
2
|
+
import { BoxInfo, ImageSpecs } from '../types/index.js';
|
|
3
|
+
import { MimeService } from '../mime/index.js';
|
|
4
|
+
import 'buffer';
|
|
5
|
+
import '../url/index.js';
|
|
6
|
+
import '../utils/index.js';
|
|
7
|
+
import '../ld/index.js';
|
|
8
|
+
|
|
9
|
+
declare class ImageServiceWorkup extends MimeService {
|
|
10
|
+
cwd: string;
|
|
11
|
+
constructor(cwd: string);
|
|
12
|
+
/**
|
|
13
|
+
* Read exactly N bytes from a stream, returning a Buffer
|
|
14
|
+
* Closes stream after reading or on error
|
|
15
|
+
*/
|
|
16
|
+
readBytes(stream: Readable, bytes: number): Promise<Buffer>;
|
|
17
|
+
parseExif(buffer: Buffer, app1Pos: number, app1Size: number): {
|
|
18
|
+
orientation: number | null;
|
|
19
|
+
dateTimeOriginal: string | null;
|
|
20
|
+
};
|
|
21
|
+
parseXmpFromAvif(buffer: Buffer, meta: BoxInfo, _ipco: BoxInfo): string | null;
|
|
22
|
+
readVarSize(buffer: Buffer, pos: number, size: number): number;
|
|
23
|
+
findBox(buffer: Buffer, type: string, start?: number, end?: number): BoxInfo | null;
|
|
24
|
+
mapChrmToColorSpace(chrm: {
|
|
25
|
+
white_x: number;
|
|
26
|
+
white_y: number;
|
|
27
|
+
red_x: number;
|
|
28
|
+
red_y: number;
|
|
29
|
+
green_x: number;
|
|
30
|
+
green_y: number;
|
|
31
|
+
blue_x: number;
|
|
32
|
+
blue_y: number;
|
|
33
|
+
}, fallback: ImageSpecs["colorSpace"]): "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
34
|
+
xmpToColorSpaceWorkup<const T extends ImageSpecs["colorSpace"] | "prophoto rgb" | "display p3" | "adobe rgb (1998)" | "rgb" | "grayscale", const V extends "iccprofile" | "colormode">(space: T, target: V): `<photoshop:${V}>${T}</photoshop:${V}>`;
|
|
35
|
+
mapXmpToColorSpace(xmpText: string, fallback: ImageSpecs["colorSpace"]): "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
36
|
+
mapProfileToColorSpace(profileName: string | null, fallback: ImageSpecs["colorSpace"]): "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { ImageServiceWorkup };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ImageServiceWorkup
|
|
3
|
+
} from "../chunk-6R36YN3W.js";
|
|
4
|
+
import "../chunk-PHTZ7NRL.js";
|
|
5
|
+
import "../chunk-UW52DMHT.js";
|
|
6
|
+
import "../chunk-6HHKXBIM.js";
|
|
7
|
+
import "../chunk-Z2WZLZC4.js";
|
|
8
|
+
import "../chunk-7QVYU63E.js";
|
|
9
|
+
export {
|
|
10
|
+
ImageServiceWorkup
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=workup.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { FsFetch } from './fs-fetch/index.js';
|
|
|
6
6
|
export { FsSize } from './fs-size/index.js';
|
|
7
7
|
export { FsTmp } from './fs-tmp/index.js';
|
|
8
8
|
export { ImageService } from './image/index.js';
|
|
9
|
+
export { ImageServiceWorkup } from './image/workup.js';
|
|
9
10
|
export { LevenshteinDistance } from './ld/index.js';
|
|
10
11
|
export { AllMimeTypes, FileExtension, FileExtensionToMimeType, InferTopLevelPresent, MimeService, MimeTopLevelType, MimeType, MimeTypeToFileExtension, PresentMimeTopLevelTypes, extMimeMap, mimeToExt } from './mime/index.js';
|
|
11
12
|
export { Abortable, ArrFieldReplacer, ArrayBufferView, ArrayOrReadOnlyArray, BashEnv, BoxInfo, BufferEncodingUnion, CTR, CoercionUnion, CommonExecOptions, CommonOptions, ConditionalPromise, ConditionalToRequired, DX, DeepPartial, DeepPartialFields, DeepReplace, Depth, Dict, Equal, ExcludeFieldEnumerable, ExecSyncOptions, ExecSyncOptionsWithBufferEncoding, ExecSyncOptionsWithStringEncoding, ExecuteCommandProps, Expect, Extends, FieldToConditionallyNever, IOType, ImageSpecs, InferDepth, InjectScriptsProps, IsExact, IsOptional, MkDirOptions, MkDirSyncOptions, MkDirSyncProps, Mode, NoParamCallback, ObjEncodingOptions, OmitSrc, OnlyOptional, OnlyRequired, OpenMode, ParsedUrlInfo, ProcessEnv, ProcessEnvOptions, RTC, ReadDirOptions, ReadDirOptionsEntity, ReadDirProps, RemoveFields, RequireNested, RequiredToConditional, Rm, RmOptions, Signals, SizeOpts, StdioOptions, TCN, TypedArray, Unenumerate, Unit, UnwrapPromise, Without, WriteFileAsyncDataUnion, WriteFileAsyncOptions, WriteFileAsyncProps, WriteStreamDataShape, WriteStreamOptions, WriteStreamProps, XOR, unitsObj } from './types/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Fs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4LZQHSBL.js";
|
|
4
4
|
import {
|
|
5
5
|
FsFetch
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MUFEXR25.js";
|
|
7
7
|
import {
|
|
8
8
|
FsTmp
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QKZIGBLD.js";
|
|
10
10
|
import {
|
|
11
11
|
FsCore
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CTSJFQMC.js";
|
|
13
13
|
import {
|
|
14
14
|
FsSize
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ZQRB46YA.js";
|
|
16
16
|
import {
|
|
17
17
|
unitsObj
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-Q6QZ5XEP.js";
|
|
19
19
|
import {
|
|
20
20
|
FsAtomic
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3RC3WC7A.js";
|
|
22
22
|
import {
|
|
23
23
|
FsBase
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-I4ITMOIV.js";
|
|
25
25
|
import {
|
|
26
26
|
ImageService
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-TUY7Y4DL.js";
|
|
28
|
+
import {
|
|
29
|
+
ImageServiceWorkup
|
|
30
|
+
} from "./chunk-6R36YN3W.js";
|
|
28
31
|
import {
|
|
29
32
|
MimeService,
|
|
30
33
|
extMimeMap,
|
|
31
34
|
mimeToExt
|
|
32
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-PHTZ7NRL.js";
|
|
33
36
|
import {
|
|
34
37
|
UrlService
|
|
35
38
|
} from "./chunk-UW52DMHT.js";
|
|
@@ -49,6 +52,7 @@ export {
|
|
|
49
52
|
FsSize,
|
|
50
53
|
FsTmp,
|
|
51
54
|
ImageService,
|
|
55
|
+
ImageServiceWorkup,
|
|
52
56
|
LevenshteinDistance,
|
|
53
57
|
MimeService,
|
|
54
58
|
UrlService,
|