exifreader 4.41.4 → 4.43.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 +12 -1
- package/dist/exif-reader.js +1 -1
- package/dist/exif-reader.js.map +1 -1
- package/package.json +10 -10
- package/src/icc-tags.js +5 -2
- package/src/image-header-iso-bmff-iloc.js +31 -11
- package/src/image-header-iso-bmff.js +29 -17
- package/src/mpf-tags.js +12 -1
- package/src/photoshop-tags.js +10 -2
- package/src/png-tags.js +2 -2
- package/src/tags-helpers.js +59 -5
- package/src/tags.js +12 -7
- package/src/utils.js +1 -1
- package/src/xmp-namespaces.js +31 -12
- package/src/xmp-tags.js +12 -3
package/README.md
CHANGED
|
@@ -214,7 +214,13 @@ come straight from the image and can contain arbitrary text, including HTML-like
|
|
|
214
214
|
markup. Never insert them into a page as HTML (for example through `innerHTML`)
|
|
215
215
|
without escaping or sanitizing them first, otherwise a crafted image could lead
|
|
216
216
|
to cross-site scripting. Use `textContent`, your framework's escaping, or a
|
|
217
|
-
sanitizer such as DOMPurify when displaying metadata.
|
|
217
|
+
sanitizer such as DOMPurify when displaying metadata. The property names inside
|
|
218
|
+
a tag value come from the image too, and a value parsed from an XMP `rdf:value`
|
|
219
|
+
element that has child elements is returned as an object without a prototype,
|
|
220
|
+
so that a property named `__proto__` can be kept. Such an object has no
|
|
221
|
+
inherited methods, and copying it into an object of your own with
|
|
222
|
+
`Object.assign` or a deep merge helper without filtering the keys could let a
|
|
223
|
+
crafted image replace that object's prototype.
|
|
218
224
|
|
|
219
225
|
#### Grouping
|
|
220
226
|
|
|
@@ -372,6 +378,11 @@ know the metadata is located at the beginning of the file. Just be aware that
|
|
|
372
378
|
it's common for the metadata to be spread out over a larger area so please try
|
|
373
379
|
it out on your set of files to know if it's suitable for your situation.
|
|
374
380
|
|
|
381
|
+
One thing to look out for is ICC profiles, which are often large. If the profile
|
|
382
|
+
does not fit inside the part you read, no ICC tags are returned for it. Use
|
|
383
|
+
`length: 'auto'` (see below) if you need the ICC tags without picking a size
|
|
384
|
+
yourself.
|
|
385
|
+
|
|
375
386
|
Note that this option only works when ExifReader handles the loading of the
|
|
376
387
|
file. If e.g. an already loaded ArrayBuffer or Buffer is passed into ExifReader,
|
|
377
388
|
the whole file will already have been loaded into memory and it's too late.
|