simple-photo-gallery 2.0.11-rc.7 → 2.0.11-rc.9

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/dist/index.cjs CHANGED
@@ -10,8 +10,8 @@ var path7 = require('path');
10
10
  var buffer = require('buffer');
11
11
  var sharp2 = require('sharp');
12
12
  var blurhash = require('blurhash');
13
- var ExifReader = require('exifreader');
14
13
  var common = require('@simple-photo-gallery/common');
14
+ var ExifReader = require('exifreader');
15
15
  var ffprobe = require('node-ffprobe');
16
16
  var os = require('os');
17
17
  var Conf = require('conf');
@@ -61,22 +61,6 @@ async function cropAndResizeImage(image, outputPath, width, height, format = "av
61
61
  withoutEnlargement: true
62
62
  }).toFormat(format).toFile(outputPath);
63
63
  }
64
- async function getImageDescription(image) {
65
- try {
66
- const tags = await ExifReader__default.default.load(image);
67
- if (tags.description?.description) return tags.description.description;
68
- if (tags.ImageDescription?.description) return tags.ImageDescription.description;
69
- if (tags.UserComment && typeof tags.UserComment === "object" && tags.UserComment !== null && "description" in tags.UserComment) {
70
- return tags.UserComment.description;
71
- }
72
- if (tags.ExtDescrAccessibility?.description) return tags.ExtDescrAccessibility.description;
73
- if (tags["Caption/Abstract"]?.description) return tags["Caption/Abstract"].description;
74
- if (tags.XPTitle?.description) return tags.XPTitle.description;
75
- if (tags.XPComment?.description) return tags.XPComment.description;
76
- } catch {
77
- return void 0;
78
- }
79
- }
80
64
  async function createImageThumbnails(image, metadata, outputPath, outputPathRetina, size) {
81
65
  const originalWidth = metadata.width || 0;
82
66
  const originalHeight = metadata.height || 0;
@@ -514,6 +498,22 @@ async function getFileMtime(filePath) {
514
498
  const stats = await fs8.promises.stat(filePath);
515
499
  return stats.mtime;
516
500
  }
501
+ async function getImageDescription(image) {
502
+ try {
503
+ const tags = await ExifReader__default.default.load(image);
504
+ if (tags.description?.description) return tags.description.description;
505
+ if (tags.ImageDescription?.description) return tags.ImageDescription.description;
506
+ if (tags.UserComment && typeof tags.UserComment === "object" && tags.UserComment !== null && "description" in tags.UserComment) {
507
+ return tags.UserComment.description;
508
+ }
509
+ if (tags.ExtDescrAccessibility?.description) return tags.ExtDescrAccessibility.description;
510
+ if (tags["Caption/Abstract"]?.description) return tags["Caption/Abstract"].description;
511
+ if (tags.XPTitle?.description) return tags.XPTitle.description;
512
+ if (tags.XPComment?.description) return tags.XPComment.description;
513
+ } catch {
514
+ return void 0;
515
+ }
516
+ }
517
517
  async function getVideoDimensions(filePath) {
518
518
  const data = await ffprobe__default.default(filePath);
519
519
  const videoStream = data.streams.find((stream) => stream.codec_type === "video");
@@ -1172,7 +1172,7 @@ async function waitForUpdateCheck(checkPromise) {
1172
1172
  // package.json
1173
1173
  var package_default = {
1174
1174
  name: "simple-photo-gallery",
1175
- version: "2.0.11-rc.7"};
1175
+ version: "2.0.11-rc.9"};
1176
1176
 
1177
1177
  // src/index.ts
1178
1178
  var program = new commander.Command();