exifreader 4.23.5 → 4.23.6

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/README.md CHANGED
@@ -232,7 +232,7 @@ const tags = ExifReader.load(fileBuffer, {expanded: true});
232
232
 
233
233
  If you're having trouble getting the GPS location, see [this comment and
234
234
  thread](https://github.com/mattiasw/ExifReader/issues/177#issuecomment-1172228225)
235
- for more details.
235
+ and the [GPS section below](#gps) for more details.
236
236
 
237
237
  #### Grouping
238
238
 
@@ -288,10 +288,11 @@ be negative for values that are south of the equator, west of the IRM, or below
288
288
  sealevel. These are often more convenient values for regular use. For some
289
289
  elaboration or if you need the original values, see [Notes](#notes) below.
290
290
 
291
- If you're having trouble getting the GPS values on Android and are using a
292
- `type="file"` input to upload the image, make sure you are not setting the
293
- `accept` attribute on the input element. Apparently setting the `accept` [will
294
- strip the GPS values](https://github.com/mattiasw/ExifReader/issues/378#issuecomment-2302705983).
291
+ If you're having trouble getting the GPS values on Android (and possibly also
292
+ IOS) and are using a `type="file"` input to upload the image, make sure you are
293
+ **not** setting `accept="image/*"` on the input element. Apparently
294
+ setting the `accept` attribute to this value [will strip the GPS
295
+ values](https://github.com/mattiasw/ExifReader/issues/378#issuecomment-2302705983).
295
296
 
296
297
  ### Using the thumbnail
297
298
 
package/bin/build.js CHANGED
@@ -7,28 +7,25 @@ const fs = require('fs');
7
7
  const {execSync} = require('child_process');
8
8
  const dependentHasExifReaderConfig = require('./findDependentConfig');
9
9
 
10
- const WEBPACK_VERSION = '5.89.0';
11
- const WEBPACK_CLI_VERSION = '5.1.4';
12
-
13
10
  const EXIFREADER_ROOT_DIR = path.join(__dirname, '..');
14
11
  process.chdir(EXIFREADER_ROOT_DIR);
15
12
 
16
13
  if (!process.argv.includes('--only-with-config') || checkConfig()) {
17
- execSync(`npx -p webpack-cli@${WEBPACK_CLI_VERSION} -p webpack@${WEBPACK_VERSION} webpack`, {stdio: 'inherit'});
14
+ execSync(`npx -p ${getPackage('webpack-cli')} -p ${getPackage('webpack')} webpack`, {stdio: 'inherit'});
18
15
  }
19
16
 
20
17
  function checkConfig() {
21
18
  if (dependentHasExifReaderConfig()) {
22
19
  console.log('Installing ExifReader custom build dependencies...'); // eslint-disable-line no-console
23
20
  const packages = [
24
- '@babel/core@7.23.2',
25
- '@babel/preset-env@7.23.2',
26
- '@babel/register@7.22.15',
27
- 'babel-loader@8.2.5',
28
- 'cross-env@7.0.3',
29
- 'string-replace-loader@3.1.0',
30
- 'terser-webpack-plugin@5.3.9'
31
- ];
21
+ '@babel/core',
22
+ '@babel/preset-env',
23
+ '@babel/register',
24
+ 'babel-loader',
25
+ 'cross-env',
26
+ 'string-replace-loader',
27
+ 'terser-webpack-plugin'
28
+ ].map((_package) => getPackage(_package));
32
29
  const tmpDir = path.join(EXIFREADER_ROOT_DIR, '__tmp');
33
30
  try {
34
31
  initTmpDir(tmpDir);
@@ -44,6 +41,11 @@ function checkConfig() {
44
41
  return false;
45
42
  }
46
43
 
44
+ function getPackage(name) {
45
+ const version = require(path.join(EXIFREADER_ROOT_DIR, 'package.json')).devDependencies[name].replace(/^\^/, '');
46
+ return `${name}@${version}`;
47
+ }
48
+
47
49
  function initTmpDir(tmpDir) {
48
50
  const nodeModulesDir = path.join(EXIFREADER_ROOT_DIR, 'node_modules');
49
51
  fs.mkdirSync(tmpDir, {recursive: true});
package/exif-reader.d.ts CHANGED
@@ -293,8 +293,8 @@ interface ExifTags {
293
293
  'SamplesPerPixel'?: NumberTag,
294
294
  'RowsPerStrip'?: NumberTag,
295
295
  'StripByteCounts'?: NumberArrayTag,
296
- 'XResolution'?: NumberTag | NumberFileTag, // Also in JFIF tags.
297
- 'YResolution'?: NumberTag | NumberFileTag, // Also in JFIF tags.
296
+ 'XResolution'?: RationalTag | NumberFileTag, // Also in JFIF tags.
297
+ 'YResolution'?: RationalTag | NumberFileTag, // Also in JFIF tags.
298
298
  'PlanarConfiguration'?: NumberTag,
299
299
  'ResolutionUnit'?: NumberTag,
300
300
  'TransferFunction'?: NumberArrayTag,
@@ -321,30 +321,30 @@ interface ExifTags {
321
321
  'JFIF Thumbnail'?: JfifThumbnailTag,
322
322
 
323
323
  // Exif tags
324
- 'ExposureTime'?: NumberTag,
325
- 'FNumber'?: NumberTag,
324
+ 'ExposureTime'?: RationalTag,
325
+ 'FNumber'?: RationalTag,
326
326
  'ExposureProgram'?: NumberTag,
327
327
  'SpectralSensitivity'?: StringArrayTag,
328
- 'ISOSpeedRatings'?: NumberTag & NumberArrayTag,
329
- 'OECF'?: NumberTag & NumberArrayTag,
328
+ 'ISOSpeedRatings'?: NumberTag | NumberArrayTag,
329
+ 'OECF'?: unknown,
330
330
  'ExifVersion'?: NumberArrayTag,
331
331
  'DateTimeOriginal'?: StringArrayTag,
332
332
  'DateTimeDigitized'?: StringArrayTag,
333
333
  'ComponentsConfiguration'?: NumberArrayTag,
334
- 'CompressedBitsPerPixel'?: NumberTag,
335
- 'ShutterSpeedValue'?: NumberTag,
336
- 'ApertureValue'?: NumberTag,
337
- 'BrightnessValue'?: NumberTag,
338
- 'ExposureBiasValue'?: NumberTag,
339
- 'MaxApertureValue'?: NumberTag,
340
- 'SubjectDistance'?: NumberTag,
334
+ 'CompressedBitsPerPixel'?: RationalTag,
335
+ 'ShutterSpeedValue'?: RationalTag,
336
+ 'ApertureValue'?: RationalTag,
337
+ 'BrightnessValue'?: RationalTag,
338
+ 'ExposureBiasValue'?: RationalTag,
339
+ 'MaxApertureValue'?: RationalTag,
340
+ 'SubjectDistance'?: RationalTag,
341
341
  'MeteringMode'?: NumberTag,
342
342
  'LightSource'?: NumberTag,
343
343
  'Flash'?: NumberTag,
344
- 'FocalLength'?: NumberTag,
344
+ 'FocalLength'?: RationalTag,
345
345
  'SubjectArea'?: NumberArrayTag,
346
- 'MakerNote'?: NumberTag & NumberArrayTag,
347
- 'UserComment'?: NumberTag & NumberArrayTag,
346
+ 'MakerNote'?: unknown,
347
+ 'UserComment'?: unknown,
348
348
  'SubSecTime'?: StringArrayTag,
349
349
  'SubSecTimeOriginal'?: StringArrayTag,
350
350
  'SubSecTimeDigitized'?: StringArrayTag,
@@ -355,27 +355,27 @@ interface ExifTags {
355
355
  'RelatedSoundFile'?: StringArrayTag,
356
356
  'Interoperability IFD Pointer'?: NumberTag,
357
357
  'FlashEnergy'?: NumberTag,
358
- 'SpatialFrequencyResponse'?: NumberTag & NumberArrayTag,
359
- 'FocalPlaneXResolution'?: NumberTag,
360
- 'FocalPlaneYResolution'?: NumberTag,
358
+ 'SpatialFrequencyResponse'?: unknown,
359
+ 'FocalPlaneXResolution'?: RationalTag,
360
+ 'FocalPlaneYResolution'?: RationalTag,
361
361
  'FocalPlaneResolutionUnit'?: NumberTag,
362
362
  'SubjectLocation'?: NumberArrayTag,
363
- 'ExposureIndex'?: NumberTag,
363
+ 'ExposureIndex'?: RationalTag,
364
364
  'SensingMethod'?: NumberTag,
365
365
  'FileSource'?: NumberTag,
366
366
  'SceneType'?: NumberTag,
367
- 'CFAPattern'?: NumberTag & NumberArrayTag,
367
+ 'CFAPattern'?: unknown,
368
368
  'CustomRendered'?: NumberTag,
369
369
  'ExposureMode'?: NumberTag,
370
370
  'WhiteBalance'?: NumberTag,
371
- 'DigitalZoomRatio'?: NumberTag,
371
+ 'DigitalZoomRatio'?: RationalTag,
372
372
  'FocalLengthIn35mmFilm'?: NumberTag,
373
373
  'SceneCaptureType'?: NumberTag,
374
374
  'GainControl'?: NumberTag,
375
375
  'Contrast'?: NumberTag,
376
376
  'Saturation'?: NumberTag,
377
377
  'Sharpness'?: NumberTag,
378
- 'DeviceSettingDescription'?: NumberTag & NumberArrayTag,
378
+ 'DeviceSettingDescription'?: unknown,
379
379
  'SubjectDistanceRange'?: NumberTag,
380
380
  'ImageUniqueID'?: StringArrayTag,
381
381
  'LensMake'?: StringArrayTag,
@@ -413,8 +413,8 @@ interface ExifTags {
413
413
  'GPSDestBearing'?: NumberTag,
414
414
  'GPSDestDistanceRef'?: StringArrayTag,
415
415
  'GPSDestDistance'?: NumberTag,
416
- 'GPSProcessingMethod'?: NumberTag & NumberArrayTag,
417
- 'GPSAreaInformation'?: NumberTag & NumberArrayTag,
416
+ 'GPSProcessingMethod'?: unknown,
417
+ 'GPSAreaInformation'?: unknown,
418
418
  'GPSDateStamp'?: StringArrayTag,
419
419
  'GPSDifferential'?: NumberTag,
420
420
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exifreader",
3
- "version": "4.23.5",
3
+ "version": "4.23.6",
4
4
  "description": "Library that parses Exif metadata in images.",
5
5
  "author": "Mattias Wallander <mattias@wallander.eu>",
6
6
  "repository": {
@@ -25,11 +25,11 @@
25
25
  "@xmldom/xmldom": "^0.8.10"
26
26
  },
27
27
  "devDependencies": {
28
- "@babel/core": "^7.23.2",
29
- "@babel/preset-env": "^7.23.2",
30
- "@babel/register": "^7.22.15",
28
+ "@babel/core": "^7.25.2",
29
+ "@babel/preset-env": "^7.25.4",
30
+ "@babel/register": "^7.24.6",
31
31
  "@types/node": "^18.11.9",
32
- "babel-loader": "^9.1.3",
32
+ "babel-loader": "^9.2.1",
33
33
  "babel-plugin-rewire": "^1.2.0",
34
34
  "chai": "^4.3.10",
35
35
  "cross-env": "^7.0.3",
@@ -42,7 +42,7 @@
42
42
  "nyc": "^17.0.0",
43
43
  "rimraf": "^5.0.5",
44
44
  "string-replace-loader": "^3.1.0",
45
- "terser-webpack-plugin": "^5.3.9",
45
+ "terser-webpack-plugin": "^5.3.10",
46
46
  "typescript": "^5.2.2",
47
47
  "webpack": "^5.89.0",
48
48
  "webpack-cli": "^5.1.4",