浏览代码

Tidying 'Remove EXIF'

n1474335 8 年之前
父节点
当前提交
369d213da5
共有 3 个文件被更改,包括 9 次插入8 次删除
  1. 2 1
      src/core/config/Categories.js
  2. 3 5
      src/core/config/OperationConfig.js
  3. 4 2
      src/core/operations/Image.js

+ 2 - 1
src/core/config/Categories.js

@@ -210,7 +210,6 @@ const Categories = [
             "XPath expression",
             "XPath expression",
             "CSS selector",
             "CSS selector",
             "Extract EXIF",
             "Extract EXIF",
-            "Remove EXIF",
         ]
         ]
     },
     },
     {
     {
@@ -289,6 +288,8 @@ const Categories = [
             "Scan for Embedded Files",
             "Scan for Embedded Files",
             "Generate UUID",
             "Generate UUID",
             "Render Image",
             "Render Image",
+            "Remove EXIF",
+            "Extract EXIF",
             "Numberwang",
             "Numberwang",
         ]
         ]
     },
     },

+ 3 - 5
src/core/config/OperationConfig.js

@@ -3370,7 +3370,7 @@ const OperationConfig = {
             "<br><br>",
             "<br><br>",
             "EXIF data from photos usually contains information about the image file itself as well as the device used to create it.",
             "EXIF data from photos usually contains information about the image file itself as well as the device used to create it.",
         ].join("\n"),
         ].join("\n"),
-        run: Image.runEXIF,
+        run: Image.runExtractEXIF,
         inputType: "byteArray",
         inputType: "byteArray",
         outputType: "string",
         outputType: "string",
         args: [],
         args: [],
@@ -3392,11 +3392,9 @@ const OperationConfig = {
         description: [
         description: [
             "Removes EXIF data from a JPEG image.",
             "Removes EXIF data from a JPEG image.",
             "<br><br>",
             "<br><br>",
-            "EXIF data is metadata embedded in JPEGs.",
-            "<br><br>",
-            "EXIF data from photos usually contains information about the image file itself as well as the device used to create it.",
+            "EXIF data embedded in photos usually contains information about the image file itself as well as the device used to create it.",
         ].join("\n"),
         ].join("\n"),
-        run: Image.removeEXIF,
+        run: Image.runRemoveEXIF,
         inputType: "byteArray",
         inputType: "byteArray",
         outputType: "byteArray",
         outputType: "byteArray",
         args: [],
         args: [],

+ 4 - 2
src/core/operations/Image.js

@@ -24,7 +24,7 @@ const Image = {
      * @param {Object[]} args
      * @param {Object[]} args
      * @returns {string}
      * @returns {string}
      */
      */
-    runEXIF(input, args) {
+    runExtractEXIF(input, args) {
         try {
         try {
             const bytes = Uint8Array.from(input);
             const bytes = Uint8Array.from(input);
             const parser = ExifParser.create(bytes.buffer);
             const parser = ExifParser.create(bytes.buffer);
@@ -44,6 +44,7 @@ const Image = {
         }
         }
     },
     },
 
 
+
     /**
     /**
      * Remove EXIF operation.
      * Remove EXIF operation.
      *
      *
@@ -54,7 +55,7 @@ const Image = {
      * @param {Object[]} args
      * @param {Object[]} args
      * @returns {string}
      * @returns {string}
      */
      */
-    removeEXIF(input, args) {
+    runRemoveEXIF(input, args) {
         // Do nothing if input is empty
         // Do nothing if input is empty
         if (input.length === 0) return input;
         if (input.length === 0) return input;
 
 
@@ -67,6 +68,7 @@ const Image = {
         }
         }
     },
     },
 
 
+
     /**
     /**
      * @constant
      * @constant
      * @default
      * @default