toivosnotebook
toivosnotebook
do resizing and mozjpeg format, thanks
toivosnotebook
sharp(input)
.resize(200, 200, {
fit: sharp.fit.outside,
withoutReduction: true
})
.toFormat('jpeg')
.toBuffer()
.then(function(outputBuffer) {
// outputBuffer contains JPEG image data
// of at least 200 pixels wide and 200 pixels high while maintaining aspect ratio
// and no smaller than the input image });
toivosnotebook
use rotate( ) to auto-rotate as EXIF auto-orientation tag
載入新的回覆