Skip to content

Commit

Permalink
bugfixes, readme, etc...
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeKovarik committed May 14, 2021
1 parent 394f626 commit f9cd3eb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Exifr does what no other JS lib does. It's **efficient** and **blazing fast**!
|`exifr.parse(file, {options})`|`object`|Custom settings|
|`exifr.gps(file)`|`{latitude, longitude}`|Parses only GPS coords|
|`exifr.orientation(file)`|`number`|Parses only orientation|
|`exifr.rotation(file)`|`object`|Returns how to rotate the photo|
|`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|

Expand Down Expand Up @@ -951,6 +951,17 @@ for (let file of files) exif.parse(file, {exif: true, iptc: true})

### Benchmarks

[pigallery2](https://github.com/bpatrik/pigallery2) did [a few](https://github.com/bpatrik/pigallery2/issues/277#issuecomment-836948216) [benchmarks](https://github.com/bpatrik/pigallery2/issues/277#issuecomment-840515653).

```
2036 photos (in total 22GB):
lib | average | all files
---------------------------------
exifr | 2.5ms | 5s <--- !!!
exifreader | 9.5ms | 19.5s
exiftool | 76ms | 154s
```

Try the benchmark yourself at [benchmark/chunked-vs-whole.js](https://github.com/MikeKovarik/exifr/blob/master/benchmark/chunked-vs-whole.js)

```
Expand Down
6 changes: 0 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ <h3>File</h3>
or
<br>
drop your file here
<!--
<br>
or try <span>these</span> examples
-->
</div>
<div if.bind="!browserCompatibleFile">
WARNING
Expand Down Expand Up @@ -137,8 +133,6 @@ <h3>Embedded thumbnail</h3>
<segment-box options.bind="options" output.bind="output" key="makerNote" display="buffer"></segment-box>
<segment-box options.bind="options" output.bind="output" key="userComment" display="buffer"></segment-box>

<!-- TODO: add IHDR -->

<div id="raw" class="wrap">
<template if.bind="rawOutput.errors && rawOutput.errors.length > 0">
<h3 class="red">${rawOutput.errors.length === 1 ? 'Error' : 'Errors'}</h3>
Expand Down
2 changes: 1 addition & 1 deletion src/parser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class AppSegmentParserBase {

static parse(input, segOptions = {}) {
let options = new Options({[this.type]: segOptions})
let instance = new this(input, options)
let instance = new this(input, options, input)
return instance.parse()
}

Expand Down
6 changes: 3 additions & 3 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
import './formats/png.spec.mjs'
import './options.spec.mjs'
import './output-format.spec.mjs'
import './highlevel-gps.spec.mjs'
import './highlevel-orientation.spec.mjs'
import './highlevel-thumb.spec.mjs'
import './highlevel/gps.spec.mjs'
import './highlevel/orientation.spec.mjs'
import './highlevel/thumb.spec.mjs'
import './tiff.spec.mjs'
import './jfif.spec.mjs'
import './icc.spec.mjs'
Expand Down

0 comments on commit f9cd3eb

Please sign in to comment.