exifreader 4.48.1 → 4.50.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/README.md CHANGED
@@ -23,21 +23,20 @@ You can try it out on the
23
23
 
24
24
  **Support table**
25
25
 
26
- | File type | Exif | IPTC | XMP | ICC | MPF | Photoshop | MakerNote | Thumbnail | Image details |
27
- | -----------------------|---------|---------|---------|---------|---------|---------------|--------------------|-----------|---------------|
28
- | JPEG | **yes** | **yes** | **yes** | **yes** | **yes** | **some*** | **some**** | **yes** | **yes** |
29
- | JPEG XL*** | **yes** | no | **yes** | no | no | no | **some**** | ??? | **yes** |
30
- | TIFF | **yes** | **yes** | **yes** | **yes** | ??? | **some*** | **some**** | **yes** | N/A |
31
- | PNG | **yes** | **yes** | **yes** | **yes** | ??? | ??? | **some**** | **yes** | **yes** |
32
- | HEIC/HEIF | **yes** | no | **yes** | **yes** | ??? | ??? | **some**** | **yes** | no |
33
- | AVIF | **yes** | no | **yes** | **yes** | ??? | ??? | **some**** | **yes** | no |
34
- | WebP | **yes** | no | **yes** | **yes** | ??? | ??? | **some**** | **yes** | **yes** |
35
- | GIF | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | **yes** |
26
+ | File type | Exif | IPTC | XMP | ICC | MPF | Photoshop | MakerNote | Thumbnail | Image details |
27
+ | -----------------------|---------|------------------------------|---------|------------------------------|---------|---------------|--------------------|-----------|---------------|
28
+ | JPEG | **yes** | **yes** | **yes** | **yes** | **yes** | **some*** | **some**** | **yes** | **yes** |
29
+ | JPEG XL*** | **yes** | **yes****** | **yes** | **some****** | N/A | **some*** | **some**** | **yes** | **yes** |
30
+ | TIFF | **yes** | **yes** | **yes** | **yes** | N/A | **some*** | **some**** | **yes** | N/A |
31
+ | PNG | **yes** | **yes** | **yes** | **yes** | N/A | **some*** | **some**** | **yes** | **yes** |
32
+ | HEIC/HEIF | **yes** | **yes****** | **yes** | **yes** | N/A | **some*** | **some**** | **yes** | **yes** |
33
+ | AVIF | **yes** | **yes****** | **yes** | **yes** | N/A | **some*** | **some**** | **yes** | **yes** |
34
+ | WebP | **yes** | **yes****** | **yes** | **yes** | N/A | **some*** | **some**** | **yes** | **yes** |
35
+ | GIF | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | **yes** |
36
36
 
37
37
  - `MakerNote` = Manufacturers' proprietary MakerNote tags.
38
38
  - `Image details` = image width, height, etc. read from image header.
39
39
  - `N/A` = The feature is not applicable to this file type.
40
- - `???` = may be supported but has not been tested.
41
40
  - `*` = A draft implementation of Photoshop tags have been added with
42
41
  `ClippingPathName` and `PathInformation` currently supported. Photoshop tags
43
42
  are very different from other tags and need a lot of extra code so they have
@@ -49,6 +48,13 @@ You can try it out on the
49
48
  compression. This is supported in some environments when using
50
49
  `async: true`. See the [Asynchronous tags](#asynchronous-tags) and
51
50
  [Custom decompression](#custom-decompression) sections for details.
51
+ JPEG XL defines no MPF block. A JPEG recompressed to JPEG XL keeps its MPF
52
+ segment only in its JPEG reconstruction data, which ExifReader does not
53
+ read.
54
+ - `****` = Read from the Exif data, where the `IPTC-NAA` and `ICC_Profile`
55
+ tags can carry them, in the same way as for TIFF files. The HEIC/HEIF,
56
+ AVIF and WebP formats define no IPTC block of their own. The ICC profile
57
+ inside a JPEG XL codestream is not read.
52
58
 
53
59
  If you're missing something that you think should be supported, file an issue
54
60
  with an attached example image and I'll see what I can do.
@@ -279,23 +285,23 @@ For PNG, filtering is done with the `png` group only. (The `pngFile` and
279
285
  `pngText` groups exist in `expanded` output today, but `png` is the filtering
280
286
  key and those groups will be deprecated later.)
281
287
 
282
- | Group key | Description | Supports IDs |
283
- | ------------- | ------------------------------------------------ | ------------ |
284
- | `exif` | Exif tags (including GPS IFD, interoperability). | yes |
285
- | `iptc` | IPTC tags. | yes |
286
- | `xmp` | XMP tags. | no |
287
- | `icc` | ICC profile tags. | no |
288
- | `photoshop` | Photoshop resource tags. | yes |
289
- | `makerNotes` | MakerNote tags (e.g. Canon/Pentax). | yes |
290
- | `mpf` | MPF tags. | yes |
291
- | `file` | JPEG file details and `FileType`. | no |
292
- | `jfif` | JFIF tags. | no |
293
- | `png` | PNG header, chunk, and text tags. | no |
294
- | `riff` | WebP (RIFF) tags. | no |
295
- | `gif` | GIF tags. | no |
296
- | `gps` | Computed GPS group (only when `expanded: true`). | no |
297
- | `composite` | Composite tags (e.g. FieldOfView). | no |
298
- | `thumbnail` | Top-level `Thumbnail` output. | no |
288
+ | Group key | Description | Supports IDs |
289
+ | ------------- | ----------------------------------------------------------------------------- | ------------ |
290
+ | `exif` | Exif tags (including GPS IFD, interoperability). | yes |
291
+ | `iptc` | IPTC tags. | yes |
292
+ | `xmp` | XMP tags. | no |
293
+ | `icc` | ICC profile tags. | no |
294
+ | `photoshop` | Photoshop resource tags. | yes |
295
+ | `makerNotes` | MakerNote tags (e.g. Canon/Pentax). | yes |
296
+ | `mpf` | MPF tags. | yes |
297
+ | `file` | JPEG file details, image details of JPEG XL, HEIC/HEIF and AVIF, and `FileType`. | no |
298
+ | `jfif` | JFIF tags. | no |
299
+ | `png` | PNG header, chunk, and text tags. | no |
300
+ | `riff` | WebP (RIFF) tags. | no |
301
+ | `gif` | GIF tags. | no |
302
+ | `gps` | Computed GPS group (only when `expanded: true`). | no |
303
+ | `composite` | Composite tags (e.g. FieldOfView). | no |
304
+ | `thumbnail` | Top-level `Thumbnail` output. | no |
299
305
 
300
306
  **Important: dependency tags**
301
307
 
@@ -303,8 +309,8 @@ Some tags act as pointers or containers to other metadata. Excluding them can
303
309
  cause other tags or entire groups to disappear. Some important examples:
304
310
 
305
311
  - `Exif IFD Pointer`, `GPS Info IFD Pointer`, `Interoperability IFD Pointer`
306
- - `IPTC-NAA` (TIFF embedded IPTC), `ApplicationNotes` (TIFF embedded XMP),
307
- `ICC_Profile` (TIFF embedded ICC)
312
+ - `IPTC-NAA` (Exif embedded IPTC), `ApplicationNotes` (Exif embedded XMP),
313
+ `ICC_Profile` (Exif embedded ICC)
308
314
  - `MakerNote` and `Make` (maker note parsing)
309
315
  - `ImageSourceData` and `PhotoshopSettings` (Photoshop parsing)
310
316
  - `JPEGInterchangeFormat` and `JPEGInterchangeFormatLength` (thumbnails)
@@ -956,10 +962,10 @@ Possible modules to include or exclude:
956
962
  | `webp` | WebP images. |
957
963
  | `jxl` | JPEG XL images. |
958
964
  | `gif` | GIF images. |
959
- | `file` | JPEG file details: image width, height etc. |
965
+ | `file` | JPEG file details: image width, height etc. The image details of JPEG XL, HEIC/HEIF and AVIF files come with their format module. |
960
966
  | `jfif` | JFIF details in JPEG files: resolution, thumbnail etc. |
961
967
  | `png_file` | PNG file details: image width, height etc. |
962
- | `exif` | Regular Exif tags. If excluded, will also exclude `photoshop`, `maker_notes`, and `thumbnail`. For TIFF files, excluding this will also exclude IPTC, XMP, and ICC. |
968
+ | `exif` | Regular Exif tags. If excluded, will also exclude `photoshop`, `maker_notes`, and `thumbnail`. Also excludes the IPTC, XMP and ICC tags that are read from the Exif data, which in TIFF files is all of them. |
963
969
  | `iptc` | IPTC tags. |
964
970
  | `xmp` | XMP tags. |
965
971
  | `icc` | ICC color profile tags. |
package/bin/cli.js CHANGED
@@ -8,6 +8,7 @@
8
8
 
9
9
  const path = require('path');
10
10
  const fs = require('fs');
11
+ const {createRequire} = require('module');
11
12
  const {readMarker, markerMatches} = require('./custom-build-marker');
12
13
  const {collectImagePaths, loadFullParser, resolveDomParser, analyzeImages, deriveConfig, writeConfigToPackageJson} = require('./analyze');
13
14
  const {verifyImages, loadCustomParser} = require('./verify-build');
@@ -547,7 +548,9 @@ function checkLocalInstall(cwd, options) {
547
548
  }
548
549
 
549
550
  function defaultResolve(cwd) {
550
- return require.resolve('exifreader/package.json', {paths: [cwd]});
551
+ // The parent sits inside node_modules so Node skips package self-reference
552
+ // (an exports map enables it) and searches cwd's node_modules chain.
553
+ return createRequire(path.join(cwd, 'node_modules', 'noop.js')).resolve('exifreader/package.json');
551
554
  }
552
555
 
553
556
  function notInstalledMessage(isPnp) {