diff --git a/index.js b/index.js index d70545c..f9c9265 100644 --- a/index.js +++ b/index.js @@ -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 @@ -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); } @@ -178,7 +187,6 @@ async function optimizeBitmap(sourcePath, format, default: abort(`unsupported format ${format}. We support: AVIF, JPG, PNG, WebP, SVG`); } - return image.toBuffer(); } diff --git a/package.json b/package.json index ba3f37f..88eaa3f 100644 --- a/package.json +++ b/package.json @@ -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"