simple-photo-gallery 2.0.11-rc.10 → 2.0.11-rc.11

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.
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var ExifReader = require('exifreader');
4
+
5
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
+
7
+ var ExifReader__default = /*#__PURE__*/_interopDefault(ExifReader);
8
+
9
+ // src/utils/descriptions.ts
10
+ async function getImageDescription(image) {
11
+ try {
12
+ const tags = await ExifReader__default.default.load(image);
13
+ if (tags.description?.description) return tags.description.description;
14
+ if (tags.ImageDescription?.description) return tags.ImageDescription.description;
15
+ if (tags.UserComment && typeof tags.UserComment === "object" && tags.UserComment !== null && "description" in tags.UserComment) {
16
+ return tags.UserComment.description;
17
+ }
18
+ if (tags.ExtDescrAccessibility?.description) return tags.ExtDescrAccessibility.description;
19
+ if (tags["Caption/Abstract"]?.description) return tags["Caption/Abstract"].description;
20
+ if (tags.XPTitle?.description) return tags.XPTitle.description;
21
+ if (tags.XPComment?.description) return tags.XPComment.description;
22
+ } catch {
23
+ return void 0;
24
+ }
25
+ }
26
+
27
+ exports.getImageDescription = getImageDescription;
28
+ //# sourceMappingURL=browser.cjs.map
29
+ //# sourceMappingURL=browser.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/descriptions.ts"],"names":["ExifReader"],"mappings":";;;;;;;;;AAOA,eAAsB,oBAAoB,KAAA,EAAmD;AAC3F,EAAA,IAAI;AACF,IAAA,MAAM,IAAA,GAAO,MAAMA,2BAAA,CAAW,IAAA,CAAK,KAAK,CAAA;AAGxC,IAAA,IAAI,IAAA,CAAK,WAAA,EAAa,WAAA,EAAa,OAAO,KAAK,WAAA,CAAY,WAAA;AAG3D,IAAA,IAAI,IAAA,CAAK,gBAAA,EAAkB,WAAA,EAAa,OAAO,KAAK,gBAAA,CAAiB,WAAA;AAGrE,IAAA,IACE,IAAA,CAAK,WAAA,IACL,OAAO,IAAA,CAAK,WAAA,KAAgB,QAAA,IAC5B,IAAA,CAAK,WAAA,KAAgB,IAAA,IACrB,aAAA,IAAiB,IAAA,CAAK,WAAA,EACtB;AACA,MAAA,OAAQ,KAAK,WAAA,CAAwC,WAAA;AAAA,IACvD;AAGA,IAAA,IAAI,IAAA,CAAK,qBAAA,EAAuB,WAAA,EAAa,OAAO,KAAK,qBAAA,CAAsB,WAAA;AAG/E,IAAA,IAAI,KAAK,kBAAkB,CAAA,EAAG,aAAa,OAAO,IAAA,CAAK,kBAAkB,CAAA,CAAE,WAAA;AAG3E,IAAA,IAAI,IAAA,CAAK,OAAA,EAAS,WAAA,EAAa,OAAO,KAAK,OAAA,CAAQ,WAAA;AAGnD,IAAA,IAAI,IAAA,CAAK,SAAA,EAAW,WAAA,EAAa,OAAO,KAAK,SAAA,CAAU,WAAA;AAAA,EACzD,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF","file":"browser.cjs","sourcesContent":["import ExifReader from 'exifreader';\n\n/**\n * Extracts description from image EXIF data\n * @param image - Image path or File object\n * @returns Promise resolving to image description or undefined if not found\n */\nexport async function getImageDescription(image: string | File): Promise<string | undefined> {\n try {\n const tags = await ExifReader.load(image);\n\n // Description\n if (tags.description?.description) return tags.description.description;\n\n // ImageDescription\n if (tags.ImageDescription?.description) return tags.ImageDescription.description;\n\n // UserComment\n if (\n tags.UserComment &&\n typeof tags.UserComment === 'object' &&\n tags.UserComment !== null &&\n 'description' in tags.UserComment\n ) {\n return (tags.UserComment as { description: string }).description;\n }\n\n // ExtDescrAccessibility\n if (tags.ExtDescrAccessibility?.description) return tags.ExtDescrAccessibility.description;\n\n // Caption/Abstract\n if (tags['Caption/Abstract']?.description) return tags['Caption/Abstract'].description;\n\n // XP Title\n if (tags.XPTitle?.description) return tags.XPTitle.description;\n\n // XP Comment\n if (tags.XPComment?.description) return tags.XPComment.description;\n } catch {\n return undefined;\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Extracts description from image EXIF data
3
+ * @param image - Image path or File object
4
+ * @returns Promise resolving to image description or undefined if not found
5
+ */
6
+ declare function getImageDescription(image: string | File): Promise<string | undefined>;
7
+
8
+ export { getImageDescription };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Extracts description from image EXIF data
3
+ * @param image - Image path or File object
4
+ * @returns Promise resolving to image description or undefined if not found
5
+ */
6
+ declare function getImageDescription(image: string | File): Promise<string | undefined>;
7
+
8
+ export { getImageDescription };
@@ -0,0 +1,23 @@
1
+ import ExifReader from 'exifreader';
2
+
3
+ // src/utils/descriptions.ts
4
+ async function getImageDescription(image) {
5
+ try {
6
+ const tags = await ExifReader.load(image);
7
+ if (tags.description?.description) return tags.description.description;
8
+ if (tags.ImageDescription?.description) return tags.ImageDescription.description;
9
+ if (tags.UserComment && typeof tags.UserComment === "object" && tags.UserComment !== null && "description" in tags.UserComment) {
10
+ return tags.UserComment.description;
11
+ }
12
+ if (tags.ExtDescrAccessibility?.description) return tags.ExtDescrAccessibility.description;
13
+ if (tags["Caption/Abstract"]?.description) return tags["Caption/Abstract"].description;
14
+ if (tags.XPTitle?.description) return tags.XPTitle.description;
15
+ if (tags.XPComment?.description) return tags.XPComment.description;
16
+ } catch {
17
+ return void 0;
18
+ }
19
+ }
20
+
21
+ export { getImageDescription };
22
+ //# sourceMappingURL=browser.js.map
23
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/descriptions.ts"],"names":[],"mappings":";;;AAOA,eAAsB,oBAAoB,KAAA,EAAmD;AAC3F,EAAA,IAAI;AACF,IAAA,MAAM,IAAA,GAAO,MAAM,UAAA,CAAW,IAAA,CAAK,KAAK,CAAA;AAGxC,IAAA,IAAI,IAAA,CAAK,WAAA,EAAa,WAAA,EAAa,OAAO,KAAK,WAAA,CAAY,WAAA;AAG3D,IAAA,IAAI,IAAA,CAAK,gBAAA,EAAkB,WAAA,EAAa,OAAO,KAAK,gBAAA,CAAiB,WAAA;AAGrE,IAAA,IACE,IAAA,CAAK,WAAA,IACL,OAAO,IAAA,CAAK,WAAA,KAAgB,QAAA,IAC5B,IAAA,CAAK,WAAA,KAAgB,IAAA,IACrB,aAAA,IAAiB,IAAA,CAAK,WAAA,EACtB;AACA,MAAA,OAAQ,KAAK,WAAA,CAAwC,WAAA;AAAA,IACvD;AAGA,IAAA,IAAI,IAAA,CAAK,qBAAA,EAAuB,WAAA,EAAa,OAAO,KAAK,qBAAA,CAAsB,WAAA;AAG/E,IAAA,IAAI,KAAK,kBAAkB,CAAA,EAAG,aAAa,OAAO,IAAA,CAAK,kBAAkB,CAAA,CAAE,WAAA;AAG3E,IAAA,IAAI,IAAA,CAAK,OAAA,EAAS,WAAA,EAAa,OAAO,KAAK,OAAA,CAAQ,WAAA;AAGnD,IAAA,IAAI,IAAA,CAAK,SAAA,EAAW,WAAA,EAAa,OAAO,KAAK,SAAA,CAAU,WAAA;AAAA,EACzD,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF","file":"browser.js","sourcesContent":["import ExifReader from 'exifreader';\n\n/**\n * Extracts description from image EXIF data\n * @param image - Image path or File object\n * @returns Promise resolving to image description or undefined if not found\n */\nexport async function getImageDescription(image: string | File): Promise<string | undefined> {\n try {\n const tags = await ExifReader.load(image);\n\n // Description\n if (tags.description?.description) return tags.description.description;\n\n // ImageDescription\n if (tags.ImageDescription?.description) return tags.ImageDescription.description;\n\n // UserComment\n if (\n tags.UserComment &&\n typeof tags.UserComment === 'object' &&\n tags.UserComment !== null &&\n 'description' in tags.UserComment\n ) {\n return (tags.UserComment as { description: string }).description;\n }\n\n // ExtDescrAccessibility\n if (tags.ExtDescrAccessibility?.description) return tags.ExtDescrAccessibility.description;\n\n // Caption/Abstract\n if (tags['Caption/Abstract']?.description) return tags['Caption/Abstract'].description;\n\n // XP Title\n if (tags.XPTitle?.description) return tags.XPTitle.description;\n\n // XP Comment\n if (tags.XPComment?.description) return tags.XPComment.description;\n } catch {\n return undefined;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-photo-gallery",
3
- "version": "2.0.11-rc.10",
3
+ "version": "2.0.11-rc.11",
4
4
  "description": "Simple Photo Gallery CLI",
5
5
  "license": "MIT",
6
6
  "author": "Vladimir Haltakov, Tomasz Rusin",