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);