Node.js: image resizing without ImageMagick

前端 未结 12 1643
离开以前
离开以前 2020-12-22 18:56

I\'m developing a web app on Node.js (+ express 4) where users can set their profile image by uploading it to the server. We already limit the file mimetype and max filesize

12条回答
  •  甜味超标
    2020-12-22 19:21

    sharp has enjoyed some popularity recently, but it’s the same idea as *Magick bindings.

    However, having to install ImageMagick/GraphicsMagick to do a simple image resizing seems too overkill for me

    Image resizing is anything but simple. The JPEG format is particularly complex, and there are several ways to scale graphics with results of varying quality, few of them easily implemented. Image processing libraries exist to do this job, so if there’s no other reason why you can’t install them, go for it.

提交回复
热议问题