exifreader 4.38.1 → 4.39.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/README.md +23 -99
- package/dist/exif-reader.js +1 -1
- package/dist/exif-reader.js.map +1 -1
- package/exif-reader.d.ts +1 -0
- package/package.json +8 -8
- package/src/icc-tags.js +12 -1
- package/src/tag-decoder.js +40 -1
- package/src/tag-names-utils.js +4 -0
- package/src/utils.js +73 -14
package/README.md
CHANGED
|
@@ -266,6 +266,27 @@ const tags = await ExifReader.load(file, {
|
|
|
266
266
|
});
|
|
267
267
|
```
|
|
268
268
|
|
|
269
|
+
#### Limiting decompressed metadata size
|
|
270
|
+
|
|
271
|
+
To avoid excessive memory use from pathological compressed inputs, ExifReader
|
|
272
|
+
caps the size of any single decompressed metadata block. The default limit is
|
|
273
|
+
128 MiB, which is well above any realistic legitimate value. You can override
|
|
274
|
+
it via the `maxDecompressedSize` field on the `decompress` option (in bytes):
|
|
275
|
+
|
|
276
|
+
```javascript
|
|
277
|
+
const tags = await ExifReader.load(file, {
|
|
278
|
+
async: true,
|
|
279
|
+
decompress: {
|
|
280
|
+
maxDecompressedSize: 16 * 1024 * 1024 // 16 MiB
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
If a compressed block would expand beyond the limit, that block is skipped, a
|
|
286
|
+
warning is logged via `console.warn`, and the rest of the tags are returned as
|
|
287
|
+
usual. The limit applies to the built-in Compression Streams paths and to any
|
|
288
|
+
result returned by a custom `brotli`/`deflate` function.
|
|
289
|
+
|
|
269
290
|
#### Grouping
|
|
270
291
|
|
|
271
292
|
By default, Exif, IPTC and XMP tags are grouped together. This means that if
|
|
@@ -654,6 +675,7 @@ Possible modules to include or exclude:
|
|
|
654
675
|
| `tiff` | TIFF images. |
|
|
655
676
|
| `png` | PNG images. |
|
|
656
677
|
| `heic` | HEIC/HEIF images. |
|
|
678
|
+
| `avif` | AVIF images. |
|
|
657
679
|
| `webp` | WebP images. |
|
|
658
680
|
| `jxl` | JPEG XL images. |
|
|
659
681
|
| `gif` | GIF images. |
|
|
@@ -664,7 +686,7 @@ Possible modules to include or exclude:
|
|
|
664
686
|
| `iptc` | IPTC tags. |
|
|
665
687
|
| `xmp` | XMP tags. |
|
|
666
688
|
| `icc` | ICC color profile tags. |
|
|
667
|
-
| `mpf` | Multi-picture Format tags.
|
|
689
|
+
| `mpf` | Multi-picture Format tags. Needs `exif` |
|
|
668
690
|
| `photoshop` | Photoshop tags. |
|
|
669
691
|
| `maker_notes` | Proprietary camera maker tags. Needs `exif`. |
|
|
670
692
|
| `thumbnail` | Thumbnail image. Needs `exif`. |
|
|
@@ -761,101 +783,3 @@ mention the use of ExifReader and make any changes to ExifReader code available
|
|
|
761
783
|
if you would to distribute your project. But please read the
|
|
762
784
|
[full license text](https://mozilla.org/MPL/2.0/) to make sure your specific
|
|
763
785
|
case is covered.
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
Changelog
|
|
767
|
-
---------
|
|
768
|
-
|
|
769
|
-
A selection of notable changes.
|
|
770
|
-
|
|
771
|
-
- **April 2026**:
|
|
772
|
-
- Add support for JPEG XL images.
|
|
773
|
-
- **January 2026**:
|
|
774
|
-
- Add `includeTags` / `excludeTags` options for filtering returned tags by
|
|
775
|
-
group and tag name/ID.
|
|
776
|
-
- **December 2025**:
|
|
777
|
-
- Add the `computed` tag property that are a middle way between the raw
|
|
778
|
-
`value` and the human-friendly `description`.
|
|
779
|
-
- **October 2024**:
|
|
780
|
-
- Add support for some proprietary tags from Canon cameras.
|
|
781
|
-
- **December 2023**:
|
|
782
|
-
- Add support for extracting Photoshop paths.
|
|
783
|
-
- Add basic support for GIF images (image dimensions, bit depths).
|
|
784
|
-
- Add support for compressed tags in PNG files (in zTXt, iTXt, and iCCP
|
|
785
|
-
chunks), including IPTC and ICC. Pass in `async: true` in `options`
|
|
786
|
-
parameter to enable. Works in environments that support the
|
|
787
|
-
[Compression Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Compression_Streams_API#browser_compatibility).
|
|
788
|
-
- **December 2022**:
|
|
789
|
-
- Add option `length` to only read the first `length` bytes of the file.
|
|
790
|
-
- **October 2021**:
|
|
791
|
-
- Major version update 4.0.0. A couple of small breaking changes that
|
|
792
|
-
shouldn't affect too many users:
|
|
793
|
-
- Node.js 10+ is needed to read XMP tags (requirement from
|
|
794
|
-
[xmldom](https://www.npmjs.com/package/@xmldom/xmldom) dependency)
|
|
795
|
-
- XMP arrays with complex items are now parsed correctly, e.g. `Regions`
|
|
796
|
-
(see [issue #129](https://github.com/mattiasw/ExifReader/issues/129)
|
|
797
|
-
for more details)
|
|
798
|
-
- [Unknown tags](#unknown-tags) are no longer included by default
|
|
799
|
-
- **June 2021**:
|
|
800
|
-
- Make it possible to directly pass in file path, URL, or File object.
|
|
801
|
-
- **December 2020**:
|
|
802
|
-
- Add support for Multi-picture Format (MPF).
|
|
803
|
-
- **May 2020**:
|
|
804
|
-
- Add support for WebP images.
|
|
805
|
-
- Add support for ICC tags in TIFF images.
|
|
806
|
-
- **April 2020**:
|
|
807
|
-
- Add support for IPTC and XMP tags in TIFF images.
|
|
808
|
-
- Add functionality to create a custom build to reduce bundle size.
|
|
809
|
-
- **March 2020**:
|
|
810
|
-
- Add support for PNG images.
|
|
811
|
-
- Add support for thumbnails in JPEGs.
|
|
812
|
-
- Major update to version 3.0. However, the actual change is quite small,
|
|
813
|
-
albeit a breaking one if you use that functionality (`.value` on
|
|
814
|
-
rational tags). Rational values are now kept in their original
|
|
815
|
-
numerator/denominator pair instead of being calculated into a float.
|
|
816
|
-
In addition to `.value` on rational tags some descriptions have also
|
|
817
|
-
changed into better ones, e.g. ExposureTime now looks like `1/200`
|
|
818
|
-
instead of `0.005`.
|
|
819
|
-
- **December 2019**:
|
|
820
|
-
- Add support for HEIC images.
|
|
821
|
-
- **November 2019**:
|
|
822
|
-
- Add support for ICC color profile tags in JPEG images.
|
|
823
|
-
- Add support for TIFF images.
|
|
824
|
-
- Add support for extended XMP.
|
|
825
|
-
- Add a lot of new tags.
|
|
826
|
-
- **January 2019**:
|
|
827
|
-
- For Node.js, remove dependency of jDataView and explicit dependency of
|
|
828
|
-
XMLDOM.
|
|
829
|
-
- Add type definitions for TypeScript.
|
|
830
|
-
- **February, 2018**:
|
|
831
|
-
- Change license to Mozilla Public License 2.0 (MPL-2.0).
|
|
832
|
-
- **December, 2017**:
|
|
833
|
-
- Add option to separate different tag groups (Exif, IPTC and XMP).
|
|
834
|
-
- **February, 2017**:
|
|
835
|
-
- Add support for XMP tags.
|
|
836
|
-
- **December, 2016**:
|
|
837
|
-
- Merge IPTC branch.
|
|
838
|
-
- Convert project to JavaScript (ECMAScript 2015) from CoffeeScript,
|
|
839
|
-
transpiling to ES5 using Babel.
|
|
840
|
-
- Remove need to instantiate the ExifReader object before use.
|
|
841
|
-
- Add UMD support (CommonJS, AMD and global).
|
|
842
|
-
- Publish as npm package.
|
|
843
|
-
- **September 17, 2014**:
|
|
844
|
-
- Lower memory usage by unsetting the file data object after parsing.
|
|
845
|
-
- Add deleteTag method to be able to delete tags that use a lot of memory,
|
|
846
|
-
e.g. MakerNote.
|
|
847
|
-
- **September 9, 2013**:
|
|
848
|
-
- Make parsing of APP markers more robust. Fixes problems with some
|
|
849
|
-
pictures.
|
|
850
|
-
- **July 13, 2013**:
|
|
851
|
-
- Throw Error instead of just strings.
|
|
852
|
-
- **April 23, 2013**:
|
|
853
|
-
- Support hybrid JFIF-EXIF image files.
|
|
854
|
-
- **April 22, 2013**:
|
|
855
|
-
- Registered with [Bower](https://bower.io/).
|
|
856
|
-
- **January 8, 2013**:
|
|
857
|
-
- Updated text about browser support.
|
|
858
|
-
- **January 19, 2012**:
|
|
859
|
-
- Added text descriptions for the tags.
|
|
860
|
-
- **January 1, 2012**:
|
|
861
|
-
- First release.
|