From 514f0d254f19bfc89d99726025288170e3a8bcbe Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 23 Jun 2021 00:09:05 +0200 Subject: [PATCH] changelog and readme --- CHANGELOG.md | 9 ++++++++- README.md | 28 ++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f160a8..0c20935 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +## [7.1.0] + +### Added +- Sidecar support through `exifr.sidecar()`. +- Support for url query strings and headers in Node.js polyfill of UrlFetcher. + ## [7.0.0] ### Added @@ -272,7 +278,8 @@ Quality-Of-Life release. Improves compatibility and ease of use with various too ### Added - initial implementation -[Unreleased]: https://github.com/MikeKovarik/exifr/compare/v7.0.0...HEAD +[Unreleased]: https://github.com/MikeKovarik/exifr/compare/v7.1.0...HEAD +[7.1.0]: https://github.com/MikeKovarik/exifr/compare/v7.0.0...v7.1.0 [7.0.0]: https://github.com/MikeKovarik/exifr/compare/v6.3.0...v7.0.0 [6.3.0]: https://github.com/MikeKovarik/exifr/compare/v6.2.0...v6.3.0 [6.2.0]: https://github.com/MikeKovarik/exifr/compare/v6.1.1...v6.2.0 diff --git a/README.md b/README.md index 65ad012..f91f56a 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ Exifr does what no other JS lib does. It's **efficient** and **blazing fast**! |`exifr.rotation(file)`|`object`|Info how to rotate the photo| |`exifr.thumbnail(file)`|`Buffer\|Uint8Array` binary|Extracts embedded thumbnail| |`exifr.thumbnailUrl(file)`|`string` Object URL|Browser only| +|`exifr.sidecar(file)`|`object`|Parses sidecar file| ## Installation @@ -281,12 +282,12 @@ and a lot more in the [examples/](examples/) folder ## API ### `parse(file[, options])` -Returns: `Promise` +Returns: `Promise` Accepts [file](#file-argument) (in any format), parses it and returns exif object. Optional [options](#options-argument) argument can be specified. ### `gps(file)` -Returns: `Promise` +Returns: `Promise` Only extracts GPS coordinates. @@ -295,12 +296,12 @@ Only extracts GPS coordinates. Check out [examples/gps.js](examples/gps.js) to learn more. ### `orientation(file)` -Returns: `Promise` +Returns: `Promise` Only extracts photo's orientation. ### `rotation(file)` -Returns: `Promise` +Returns: `Promise` Only extracts photo's orientation. Returns object with instructions how to rotate the image: @@ -322,7 +323,7 @@ if (r.css) { ``` ### `thumbnail(file)` -Returns: `Promise` +Returns: `Promise` Extracts embedded thumbnail from the photo, returns `Uint8Array`. @@ -331,12 +332,27 @@ Extracts embedded thumbnail from the photo, returns `Uint8Array`. Check out [examples/thumbnail.html](examples/thumbnail.html) and [examples/thumbnail.js](examples/thumbnail.js) to learn more. ### `thumbnailUrl(file)` -Returns: `Promise` +Returns: `Promise`
browser only Exports the thumbnail wrapped in [Object URL](https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications#Example_Using_object_URLs_to_display_images). The URL has to be revoked when not needed anymore. +### `sidecar(file[, options[, type]])` +Returns: `Promise` +
+full bundle only + +Parses sidecar file, i.e., an external metadata usually accompanied by the image file. Most notably `.xmp` or `.icc`. + +Third argument is optional but advised if you know the segment type you're dealing with and want to improve performance. Otherwise exifr tries to infer the type from file extension (if `file` is path or url) and/or randomly tries all parsers at its disposal. + +```js +exifr.sidecar('./img_1234.icc') +exifr.sidecar('./img_1234.icc', {translateKeys: false}) +exifr.sidecar('./img_1234.colorprofile', {translateKeys: false}, 'icc') +``` + ### `Exifr` class Aforementioned functions are wrappers that internally: