We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As the title, e.g. I need to extend transforms:
const extendTransforms = (builtins) => { const getBase64 = async (image) => { const img = image.resize({ width: 10 }); const buf = await img.toBuffer(); const mt = await img.metadata(); return `data:image/${mt.format};base64,${buf.toString("base64")}`; }; function base64(config, ctx) { if (config.width != "10") return; return async (image) => { setMetadata(image, "base64", await getBase64(image)); return image; }; } return [base64, ...builtins]; };
imagetools({ extendTransforms })
The text was updated successfully, but these errors were encountered:
Absolutely! I already committed the change, it should go to npm in a couple minutes! One caveat however: On the transform functions can be async, so
function blur() { return async () => {} }
would work, but
async function blur() { return () => {} }
would not. This shouldn't be a problem for most use cases though.
Sorry, something went wrong.
da3e726
No branches or pull requests
As the title, e.g. I need to extend transforms:
The text was updated successfully, but these errors were encountered: