@d0paminedriven/fs 7.5.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.
Files changed (36) hide show
  1. package/dist/{chunk-6UANVLO3.js → chunk-3RC3WC7A.js} +2 -2
  2. package/dist/{chunk-LYQ3KQSL.js → chunk-4LZQHSBL.js} +2 -2
  3. package/dist/chunk-6R36YN3W.js +386 -0
  4. package/dist/{chunk-HQ2FHXLJ.js → chunk-CTSJFQMC.js} +2 -2
  5. package/dist/{chunk-DSH3OL5Q.js → chunk-I4ITMOIV.js} +2 -2
  6. package/dist/{chunk-F57L5MBU.js → chunk-MUFEXR25.js} +2 -2
  7. package/dist/{chunk-KNLXF622.js → chunk-PHTZ7NRL.js} +26 -6
  8. package/dist/{chunk-4DZLRFGH.js → chunk-Q6QZ5XEP.js} +1 -1
  9. package/dist/{chunk-N33N54TN.js → chunk-QKZIGBLD.js} +2 -2
  10. package/dist/{chunk-3MPIZJSN.js → chunk-TUY7Y4DL.js} +502 -326
  11. package/dist/{chunk-CJBGTYSB.js → chunk-ZQRB46YA.js} +3 -3
  12. package/dist/fs/index.d.ts +60 -7
  13. package/dist/fs/index.js +11 -10
  14. package/dist/fs-atomic/index.d.ts +1 -0
  15. package/dist/fs-atomic/index.js +5 -4
  16. package/dist/fs-base/index.d.ts +1 -0
  17. package/dist/fs-base/index.js +4 -3
  18. package/dist/fs-core/index.d.ts +2 -1
  19. package/dist/fs-core/index.js +8 -7
  20. package/dist/fs-fetch/index.d.ts +4 -3
  21. package/dist/fs-fetch/index.js +10 -9
  22. package/dist/fs-size/index.d.ts +1 -0
  23. package/dist/fs-size/index.js +7 -6
  24. package/dist/fs-tmp/index.d.ts +1 -0
  25. package/dist/fs-tmp/index.js +9 -8
  26. package/dist/image/index.d.ts +180 -37
  27. package/dist/image/index.js +3 -2
  28. package/dist/image/workup.d.ts +39 -0
  29. package/dist/image/workup.js +12 -0
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.js +14 -10
  32. package/dist/mime/index.d.ts +45 -15
  33. package/dist/mime/index.js +1 -1
  34. package/dist/types/index.d.ts +2 -2
  35. package/dist/types/index.js +1 -1
  36. package/package.json +14 -10
@@ -1,20 +1,16 @@
1
1
  import { Readable } from 'node:stream';
2
2
  import { ImageSpecs } from '../types/index.js';
3
- import { MimeService } from '../mime/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 MimeService {
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
- readBytes(stream: Readable, bytes: number): Promise<Buffer>;
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,14 +32,6 @@ declare class ImageService extends MimeService {
36
32
  private extractBMPFromBuffer;
37
33
  private extractWebPFromBuffer;
38
34
  private extractAVIFFromBuffer;
39
- private parseExif;
40
- private parseXmpFromAvif;
41
- private readVarSize;
42
- private findBox;
43
- private mapChrmToColorSpace;
44
- private xmpToColorSpaceWorkup;
45
- private mapXmpToColorSpace;
46
- private mapProfileToColorSpace;
47
35
  extractViaStream(stream: Readable, size?: number): Promise<{
48
36
  width: number;
49
37
  height: number;
@@ -54,7 +42,7 @@ declare class ImageService extends MimeService {
54
42
  colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed";
55
43
  orientation: null;
56
44
  aspectRatio: number;
57
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
45
+ colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
58
46
  iccProfile: string | null;
59
47
  exifDateTimeOriginal: string | null;
60
48
  } | {
@@ -66,8 +54,8 @@ declare class ImageService extends MimeService {
66
54
  hasAlpha: false;
67
55
  orientation: number | null;
68
56
  aspectRatio: number;
69
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
70
- colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
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";
71
59
  iccProfile: string | null;
72
60
  exifDateTimeOriginal: string | null;
73
61
  } | {
@@ -92,7 +80,7 @@ declare class ImageService extends MimeService {
92
80
  hasAlpha: null;
93
81
  orientation: number;
94
82
  aspectRatio: number;
95
- colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
83
+ colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
96
84
  colorSpace: "unknown";
97
85
  iccProfile: null;
98
86
  exifDateTimeOriginal: null;
@@ -106,7 +94,7 @@ declare class ImageService extends MimeService {
106
94
  colorModel: "unknown" | "rgb" | "rgba";
107
95
  orientation: null;
108
96
  aspectRatio: number;
109
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
97
+ colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
110
98
  iccProfile: string | null;
111
99
  exifDateTimeOriginal: null;
112
100
  } | {
@@ -115,11 +103,63 @@ declare class ImageService extends MimeService {
115
103
  format: "avif";
116
104
  frames: number;
117
105
  animated: boolean;
118
- colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
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;
119
145
  hasAlpha: true | null;
120
146
  orientation: null;
121
147
  aspectRatio: number;
122
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
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";
123
163
  iccProfile: string | null;
124
164
  exifDateTimeOriginal: string | null;
125
165
  }>;
@@ -133,7 +173,7 @@ declare class ImageService extends MimeService {
133
173
  colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed";
134
174
  orientation: null;
135
175
  aspectRatio: number;
136
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
176
+ colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
137
177
  iccProfile: string | null;
138
178
  exifDateTimeOriginal: string | null;
139
179
  } | {
@@ -145,8 +185,8 @@ declare class ImageService extends MimeService {
145
185
  hasAlpha: false;
146
186
  orientation: number | null;
147
187
  aspectRatio: number;
148
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
149
- colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
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";
150
190
  iccProfile: string | null;
151
191
  exifDateTimeOriginal: string | null;
152
192
  } | {
@@ -171,7 +211,7 @@ declare class ImageService extends MimeService {
171
211
  hasAlpha: null;
172
212
  orientation: number;
173
213
  aspectRatio: number;
174
- colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
214
+ colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
175
215
  colorSpace: "unknown";
176
216
  iccProfile: null;
177
217
  exifDateTimeOriginal: null;
@@ -185,7 +225,7 @@ declare class ImageService extends MimeService {
185
225
  colorModel: "unknown" | "rgb" | "rgba";
186
226
  orientation: null;
187
227
  aspectRatio: number;
188
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
228
+ colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
189
229
  iccProfile: string | null;
190
230
  exifDateTimeOriginal: null;
191
231
  } | {
@@ -194,15 +234,66 @@ declare class ImageService extends MimeService {
194
234
  format: "avif";
195
235
  frames: number;
196
236
  animated: boolean;
197
- colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
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";
198
251
  hasAlpha: true | null;
199
252
  orientation: null;
200
253
  aspectRatio: number;
201
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
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";
202
294
  iccProfile: string | null;
203
295
  exifDateTimeOriginal: string | null;
204
296
  }>;
205
- private readonly signatures;
206
297
  /**
207
298
  * Probe image from various sources
208
299
  * Handles local Buffer, remote URL, or S3 object
@@ -224,7 +315,7 @@ declare class ImageService extends MimeService {
224
315
  colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed";
225
316
  orientation: null;
226
317
  aspectRatio: number;
227
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
318
+ colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
228
319
  iccProfile: string | null;
229
320
  exifDateTimeOriginal: string | null;
230
321
  } | {
@@ -236,8 +327,8 @@ declare class ImageService extends MimeService {
236
327
  hasAlpha: false;
237
328
  orientation: number | null;
238
329
  aspectRatio: number;
239
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
240
- colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
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";
241
332
  iccProfile: string | null;
242
333
  exifDateTimeOriginal: string | null;
243
334
  } | {
@@ -262,7 +353,7 @@ declare class ImageService extends MimeService {
262
353
  hasAlpha: null;
263
354
  orientation: number;
264
355
  aspectRatio: number;
265
- colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
356
+ colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab";
266
357
  colorSpace: "unknown";
267
358
  iccProfile: null;
268
359
  exifDateTimeOriginal: null;
@@ -276,7 +367,7 @@ declare class ImageService extends MimeService {
276
367
  colorModel: "unknown" | "rgb" | "rgba";
277
368
  orientation: null;
278
369
  aspectRatio: number;
279
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
370
+ colorSpace: "unknown" | "cmyk" | "lab" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "xyz" | "gray";
280
371
  iccProfile: string | null;
281
372
  exifDateTimeOriginal: null;
282
373
  } | {
@@ -285,11 +376,63 @@ declare class ImageService extends MimeService {
285
376
  format: "avif";
286
377
  frames: number;
287
378
  animated: boolean;
288
- colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
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";
289
393
  hasAlpha: true | null;
290
394
  orientation: null;
291
395
  aspectRatio: number;
292
- colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
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";
293
436
  iccProfile: string | null;
294
437
  exifDateTimeOriginal: string | null;
295
438
  };
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  ImageService
3
- } from "../chunk-3MPIZJSN.js";
4
- import "../chunk-KNLXF622.js";
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-LYQ3KQSL.js";
3
+ } from "./chunk-4LZQHSBL.js";
4
4
  import {
5
5
  FsFetch
6
- } from "./chunk-F57L5MBU.js";
6
+ } from "./chunk-MUFEXR25.js";
7
7
  import {
8
8
  FsTmp
9
- } from "./chunk-N33N54TN.js";
9
+ } from "./chunk-QKZIGBLD.js";
10
10
  import {
11
11
  FsCore
12
- } from "./chunk-HQ2FHXLJ.js";
12
+ } from "./chunk-CTSJFQMC.js";
13
13
  import {
14
14
  FsSize
15
- } from "./chunk-CJBGTYSB.js";
15
+ } from "./chunk-ZQRB46YA.js";
16
16
  import {
17
17
  unitsObj
18
- } from "./chunk-4DZLRFGH.js";
18
+ } from "./chunk-Q6QZ5XEP.js";
19
19
  import {
20
20
  FsAtomic
21
- } from "./chunk-6UANVLO3.js";
21
+ } from "./chunk-3RC3WC7A.js";
22
22
  import {
23
23
  FsBase
24
- } from "./chunk-DSH3OL5Q.js";
24
+ } from "./chunk-I4ITMOIV.js";
25
25
  import {
26
26
  ImageService
27
- } from "./chunk-3MPIZJSN.js";
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-KNLXF622.js";
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,