Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
c3f840e1be | |||
6840d94517 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartjimp",
|
"name": "@push.rocks/smartjimp",
|
||||||
"version": "1.0.16",
|
"version": "1.0.17",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a tool fr working with images in TypeScript",
|
"description": "a tool fr working with images in TypeScript",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartjimp',
|
name: '@push.rocks/smartjimp',
|
||||||
version: '1.0.16',
|
version: '1.0.17',
|
||||||
description: 'a tool fr working with images in TypeScript'
|
description: 'a tool fr working with images in TypeScript'
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,9 @@ export class SmartJimp {
|
|||||||
let sharpImage = sharp(assetBufferArg);
|
let sharpImage = sharp(assetBufferArg);
|
||||||
sharpImage = sharpImage.resize(assetVariationArg.width, assetVariationArg.height);
|
sharpImage = sharpImage.resize(assetVariationArg.width, assetVariationArg.height);
|
||||||
const resultResize = sharpImage.resize(assetVariationArg.width, assetVariationArg.height);
|
const resultResize = sharpImage.resize(assetVariationArg.width, assetVariationArg.height);
|
||||||
|
if (assetVariationArg.invert) {
|
||||||
|
// TODO: implement invert
|
||||||
|
}
|
||||||
switch (assetVariationArg.format) {
|
switch (assetVariationArg.format) {
|
||||||
case 'avif':
|
case 'avif':
|
||||||
sharpImage = resultResize.avif();
|
sharpImage = resultResize.avif();
|
||||||
|
Reference in New Issue
Block a user