Skip to content

Commit

Permalink
Tidying 'Remove EXIF'
Browse files Browse the repository at this point in the history
  • Loading branch information
n1474335 committed Jun 8, 2017
1 parent e92775e commit 369d213
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/core/config/Categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ const Categories = [
"XPath expression",
"CSS selector",
"Extract EXIF",
"Remove EXIF",
]
},
{
Expand Down Expand Up @@ -289,6 +288,8 @@ const Categories = [
"Scan for Embedded Files",
"Generate UUID",
"Render Image",
"Remove EXIF",
"Extract EXIF",
"Numberwang",
]
},
Expand Down
8 changes: 3 additions & 5 deletions src/core/config/OperationConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -3370,7 +3370,7 @@ const OperationConfig = {
"<br><br>",
"EXIF data from photos usually contains information about the image file itself as well as the device used to create it.",
].join("\n"),
run: Image.runEXIF,
run: Image.runExtractEXIF,
inputType: "byteArray",
outputType: "string",
args: [],
Expand All @@ -3392,11 +3392,9 @@ const OperationConfig = {
description: [
"Removes EXIF data from a JPEG image.",
"<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"),
run: Image.removeEXIF,
run: Image.runRemoveEXIF,
inputType: "byteArray",
outputType: "byteArray",
args: [],
Expand Down
6 changes: 4 additions & 2 deletions src/core/operations/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Image = {
* @param {Object[]} args
* @returns {string}
*/
runEXIF(input, args) {
runExtractEXIF(input, args) {
try {
const bytes = Uint8Array.from(input);
const parser = ExifParser.create(bytes.buffer);
Expand All @@ -44,6 +44,7 @@ const Image = {
}
},


/**
* Remove EXIF operation.
*
Expand All @@ -54,7 +55,7 @@ const Image = {
* @param {Object[]} args
* @returns {string}
*/
removeEXIF(input, args) {
runRemoveEXIF(input, args) {
// Do nothing if input is empty
if (input.length === 0) return input;

Expand All @@ -67,6 +68,7 @@ const Image = {
}
},


/**
* @constant
* @default
Expand Down

0 comments on commit 369d213

Please sign in to comment.