JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q32391F
  • License ISC

基于canvas的轻量级浏览器端位图处理插件 (gif, png, jpeg)

Package Exports

  • bitmap-min

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bitmap-min) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

bitmap-min

基于canvas的轻量级浏览器端位图处理插件 (gif, png, jpeg)

var bitmapMin = new BitmapMin({
  width: 1024,  // 最大宽度
  height: 1024, // 最大高度
  jpeg: false,  // 强制转为 jpeg|jpg
  quality: .92, // jpeg|jpg 图片的质量
})

bitmapMin.load(file_or_blob, function(base64, blob) {
  document.getElementById('test').src = base64
})