fix(core): update
This commit is contained in:
parent
8566c5f57f
commit
33e8ba5f30
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartjimp',
|
name: '@push.rocks/smartjimp',
|
||||||
version: '1.0.15',
|
version: '1.0.16',
|
||||||
description: 'a tool fr working with images in TypeScript'
|
description: 'a tool fr working with images in TypeScript'
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ export interface IAssetVariation {
|
|||||||
format?: 'avif' | 'webp' | 'png';
|
format?: 'avif' | 'webp' | 'png';
|
||||||
width?: number;
|
width?: number;
|
||||||
height?: number;
|
height?: number;
|
||||||
|
invert?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ISmartJimpOptions {
|
export interface ISmartJimpOptions {
|
||||||
@ -80,6 +81,9 @@ export class SmartJimp {
|
|||||||
if (assetVariationArg.width || assetVariationArg.height) {
|
if (assetVariationArg.width || assetVariationArg.height) {
|
||||||
jimpImage = jimpImage.resize(assetVariationArg.width, assetVariationArg.height);
|
jimpImage = jimpImage.resize(assetVariationArg.width, assetVariationArg.height);
|
||||||
}
|
}
|
||||||
|
if (assetVariationArg.invert) {
|
||||||
|
jimpImage = jimpImage.invert();
|
||||||
|
}
|
||||||
switch (assetVariationArg.format) {
|
switch (assetVariationArg.format) {
|
||||||
case 'png':
|
case 'png':
|
||||||
return await jimpImage.getBufferAsync(jimp.MIME_PNG);
|
return await jimpImage.getBufferAsync(jimp.MIME_PNG);
|
||||||
|
Loading…
Reference in New Issue
Block a user