Skip to content

Commit

Permalink
changelog and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeKovarik committed Jun 22, 2021
1 parent 4c073f4 commit 514f0d2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -281,12 +282,12 @@ and a lot more in the [examples/](examples/) folder
## API

### `parse(file[, options])`
Returns: `Promise<object>`
Returns: `Promise<object | undefined>`

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<object>`
Returns: `Promise<object | undefined>`

Only extracts GPS coordinates.

Expand All @@ -295,12 +296,12 @@ Only extracts GPS coordinates.
Check out [examples/gps.js](examples/gps.js) to learn more.

### `orientation(file)`
Returns: `Promise<number>`
Returns: `Promise<number | undefined>`

Only extracts photo's orientation.

### `rotation(file)`
Returns: `Promise<object>`
Returns: `Promise<object | undefined>`

Only extracts photo's orientation. Returns object with instructions how to rotate the image:

Expand All @@ -322,7 +323,7 @@ if (r.css) {
```

### `thumbnail(file)`
Returns: `Promise<Buffer|Uint8Array>`
Returns: `Promise<Buffer | Uint8Array | undefined>`

Extracts embedded thumbnail from the photo, returns `Uint8Array`.

Expand All @@ -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<string>`
Returns: `Promise<string | undefined>`
<br>
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<object | undefined>`
<br>
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:
Expand Down

0 comments on commit 514f0d2

Please sign in to comment.