Home > Mobile >  Can I use Sharp image processing library in React js?
Can I use Sharp image processing library in React js?

Time:11-03

I try to use enter image description here

This is my code

import sharp from 'sharp';

const buffer = await sharp(req.file.buffer)
          .resize({ width: 250, height: 250 })
          .extend({
            top: 10,
            bottom: 10,
            left: 10,
            right: 10,
            background:  '#d7d8de'
          })
          .png()

CodePudding user response:

No.

Sharp uses the node.js runtime as well as binary executable code that is installed on the host system. All this means that Sharp does not work in a web browser.

  • Related