Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ let sharp = require("sharp");
let svgo = require("svgo");
let { stat, readFile } = require("fs").promises;
let { abort } = require("faucet-pipeline-core/lib/util");
let { exiftool } = require("exiftool-vendored");

// we can optimize the settings here, but some would require libvips
// to be compiled with additional stuff
Expand Down Expand Up @@ -130,6 +131,14 @@ async function processFile(fileName,
if(fingerprint !== undefined) {
writeOptions.fingerprint = fingerprint;
}

let tags = await exiftool.read(sourcePath);
let meta = {};
if(tags) {
meta.exif = tags;
}

writeOptions.meta = meta;
return assetManager.writeFile(targetPath, output, writeOptions);
}

Expand Down Expand Up @@ -178,7 +187,6 @@ async function optimizeBitmap(sourcePath, format,
default:
abort(`unsupported format ${format}. We support: AVIF, JPG, PNG, WebP, SVG`);
}

return image.toBuffer();
}

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"homepage": "https://www.faucet-pipeline.org",
"dependencies": {
"exiftool-vendored": "^15.11.0",
"faucet-pipeline-core": "^1.7.0",
"sharp": "^0.30.1",
"svgo": "^2.8.0"
Expand Down