thumbnail all the things
creates a queue of images and converts them asynchronously into thumbnails
- Resize Image
- Scale Resize
- crop image
- generate multiple resolution of image
npm install @zujo/thumbnail-generator
const { ScaleThumb,generateThumb,Resize,cropthumbCoor,generateThumbwithsize} = require("@zujo/thumbnail-generator");
const filepath = "./test.jpg"
const jpgpath = path.join(__dirname, './test');
const fileName = String;
generateThumb(source, destination path, imagefileType)
generateThumb(
filepath,
`${jpgpath}/${fileName}`,
`${'.png'}`
)
generateThumbwithsize(source, destination path, sizes,type)
generateThumbwithsize(
filepath,
`${jpgpath}/${fileName}`,
500,`${'.png'}`
)
ScaleThumb(source, destination path, type,current_image_width,current_image_height,ratio_with_floating_point)
ScaleThumb(
filepath,
`${jpgpath}/${fileName}`,
`${'.png'}`,
500,500,0.2)
cropthumbCoor(source,destination path,type,top,left,width,height)
cropthumbCoor(filepath,
`${jpgpath}/${fileName}`,
`${'.png'}`,
20,20,200,200)
Resize(source,destination path,type,height,width)
Resize(
filepath,
`${jpgpath}/${fileName}`,
`${'.png'}`,
500,500)
npm install @zujo/thumbnail-generator
Copyright 2019 Made with 💓 By ZUJO