exifreader 4.3.1 → 4.5.1

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/exif-reader.d.ts CHANGED
@@ -131,7 +131,7 @@ interface ExpandedTags {
131
131
  pngFile?: PngFileTags,
132
132
  exif?: Tags,
133
133
  iptc?: Tags,
134
- xmp?: XmpTags,
134
+ xmp?: { _raw: string } & XmpTags,
135
135
  icc?: IccTags,
136
136
  Thumbnail?: ThumbnailTags,
137
137
  gps?: GpsTags
@@ -179,6 +179,9 @@ interface MPFImageTags {
179
179
  export function load(data: ArrayBuffer | SharedArrayBuffer | Buffer): Tags & XmpTags & IccTags;
180
180
  export function load(data: ArrayBuffer | SharedArrayBuffer | Buffer, options: {expanded: true}): ExpandedTags;
181
181
  export function load(data: ArrayBuffer | SharedArrayBuffer | Buffer, options: {expanded?: false}): Tags & XmpTags & IccTags;
182
+ export function load(data: string | File): Promise<Tags & XmpTags & IccTags>;
183
+ export function load(data: string | File, options: {expanded: true}): Promise<ExpandedTags>;
184
+ export function load(data: string | File, options: {expanded?: false}): Promise<Tags & XmpTags & IccTags>;
182
185
  export function loadView(data: DataView): Tags & XmpTags & IccTags;
183
186
  export function loadView(data: DataView, options: {expanded: true}): ExpandedTags;
184
187
  export function loadView(data: DataView, options: {expanded?: false}): Tags & XmpTags & IccTags;
@@ -417,7 +420,9 @@ interface Tags {
417
420
  'Size Mode'?: NumberArrayTag, // NumberTag
418
421
  'Max Subfile Size'?: NumberArrayTag, // NumberTag
419
422
  'ObjectData Size Announced'?: NumberArrayTag, // NumberTag
420
- 'Maximum ObjectData Size'?: NumberArrayTag // NumberTag
423
+ 'Maximum ObjectData Size'?: NumberArrayTag, // NumberTag
424
+
425
+ 'Thumbnail'?: ThumbnailTags
421
426
  }
422
427
 
423
428
  interface IccTags {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exifreader",
3
- "version": "4.3.1",
3
+ "version": "4.5.1",
4
4
  "description": "Library that parses Exif metadata in images.",
5
5
  "author": "Mattias Wallander <mattias@wallander.eu>",
6
6
  "repository": {
@@ -21,7 +21,6 @@
21
21
  "webpack.config.js"
22
22
  ],
23
23
  "types": "./exif-reader.d.ts",
24
- "dependencies": {},
25
24
  "optionalDependencies": {
26
25
  "@xmldom/xmldom": "^0.7.5"
27
26
  },
@@ -9,6 +9,9 @@ export default {
9
9
  0x829a: {
10
10
  'name': 'ExposureTime',
11
11
  'description': (value) => {
12
+ if (value[0] >= value[1]) {
13
+ return `${Math.round(value[0] / value[1])}`;
14
+ }
12
15
  if (value[0] !== 0) {
13
16
  return `1/${Math.round(value[1] / value[0])}`;
14
17
  }
@@ -105,7 +108,11 @@ export default {
105
108
  0x9201: {
106
109
  'name': 'ShutterSpeedValue',
107
110
  'description': (value) => {
108
- return `1/${Math.round(Math.pow(2, value[0] / value[1]))}`;
111
+ const denominator = Math.pow(2, value[0] / value[1]);
112
+ if (denominator <= 1) {
113
+ return `${Math.round(1 / denominator)}`;
114
+ }
115
+ return `1/${Math.round(denominator)}`;
109
116
  }
110
117
  },
111
118
  0x9202: {