@thi.ng/imago
Version:
JSON & API-based declarative and extensible image processing trees/pipelines
18 lines (17 loc) • 542 B
JavaScript
import { illegalArgs } from "@thi.ng/errors";
import { resolve } from "node:path";
const iccProc = async (opts, src, ctx) => {
const $opts = opts;
if ($opts.profile) {
ctx.logger.info("setting ICC profile:", $opts.profile);
return [src.withIccProfile($opts.profile), false];
} else if ($opts.path) {
ctx.logger.info("setting ICC profile:", $opts.path);
ctx.opts.keepICC = false;
return [src.withIccProfile(resolve($opts.path)), false];
}
illegalArgs("require ICC profile name or path");
};
export {
iccProc
};