compresso
打开应用

Compress images before upload

Drop compresso.js into your file input handler: compress(file) returns an optimized File ready to upload. Images never leave the browser until your code sends them.

使用方法

  1. npm install compresso.js
  2. Call compress(file, { quality: 0.8, maxWidth: 1920, format: "auto" }) on change.
  3. Upload result.file instead of the original.

常见问题

Works with multipart forms?
Yes. result.file is a standard File object for FormData.
Need a backend?
No. Compression is 100% client-side.

开发者

在上传流程中嵌入压缩:

npm install compresso.js
npm · Docs

相关页面