From 33e8ba5f306b3fdde4cf7d4d364b30497d8bc8c2 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sun, 3 Dec 2023 23:30:58 +0100 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/smartjimp.classes.smartjimp.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index cbe53c3..f650d82 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartjimp', - version: '1.0.15', + version: '1.0.16', description: 'a tool fr working with images in TypeScript' } diff --git a/ts/smartjimp.classes.smartjimp.ts b/ts/smartjimp.classes.smartjimp.ts index 26f08f5..965a450 100644 --- a/ts/smartjimp.classes.smartjimp.ts +++ b/ts/smartjimp.classes.smartjimp.ts @@ -5,6 +5,7 @@ export interface IAssetVariation { format?: 'avif' | 'webp' | 'png'; width?: number; height?: number; + invert?: boolean; } export interface ISmartJimpOptions { @@ -80,6 +81,9 @@ export class SmartJimp { if (assetVariationArg.width || assetVariationArg.height) { jimpImage = jimpImage.resize(assetVariationArg.width, assetVariationArg.height); } + if (assetVariationArg.invert) { + jimpImage = jimpImage.invert(); + } switch (assetVariationArg.format) { case 'png': return await jimpImage.getBufferAsync(jimp.MIME_PNG);