exif-reader
Advanced tools
Comparing version 1.1.0 to 1.2.0
10
index.js
@@ -29,3 +29,3 @@ var tags = require('./tags'); | ||
var result = {}; | ||
var result = { bigEndian }; | ||
var ifd0 = readTags(buffer, ifdOffset, bigEndian, tags.exif, startingOffset); | ||
@@ -114,6 +114,10 @@ result.image = ifd0; | ||
} | ||
// Special case for ascii strings | ||
if (type === 2) { | ||
var string = buffer.toString('ascii', valueOffset, valueOffset + numValues); | ||
var asciiSlice = buffer.slice(valueOffset, valueOffset + numValues); | ||
if (asciiSlice.some(x => x >> 7 > 0)) | ||
return asciiSlice; | ||
var string = asciiSlice.toString('ascii'); | ||
if (string[string.length - 1] === '\0') // remove null terminator | ||
@@ -120,0 +124,0 @@ string = string.slice(0, -1); |
{ | ||
"name": "exif-reader", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "A small EXIF image metadata reader", | ||
@@ -13,3 +13,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "UNEXPECTED_CHECK_MAX_ITERATIONS=1000 mocha" | ||
"test": "UNEXPECTED_CHECK_MAX_ITERATIONS=10000 mocha" | ||
}, | ||
@@ -33,6 +33,6 @@ "repository": { | ||
"chance-generators": "^3.5.2", | ||
"mocha": "^6.2.0", | ||
"unexpected": "^11.8.0", | ||
"unexpected-check": "^2.2.0" | ||
"mocha": "^10.2.0", | ||
"unexpected": "^13.1.0", | ||
"unexpected-check": "^3.1.0" | ||
} | ||
} |
@@ -19,4 +19,5 @@ # exif-reader | ||
Resulting properties are grouped into four objects: | ||
Resulting properties are grouped as follows: | ||
* `bigEndian`: determines the endianness of the buffers (in case of non-ascii data) | ||
* `image`: basic TIFF properties about the image | ||
@@ -33,3 +34,4 @@ * `thumbnail`: basic TIFF properties about the embedded thumbnail | ||
```javascript | ||
{ image: | ||
{ bigEndian: true, | ||
image: | ||
{ Make: 'Apple', | ||
@@ -36,0 +38,0 @@ Model: 'iPhone 6', |
24212
5
667
98