1.0.0 • Published 5 years ago

gifshotjs-miniprogram v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

USAGE

setup

1.setup "workers": "workers" in weixin miniprogram's app.json 2.place worker/worker.js to miniprogramRoot/workers/

createGIF

import gifshot from 'gifshot';

gifshot.createGIF({
  canvas: cvs/*miniprogram canavs instance*/,
  gifWidth: gifWidth/*destGifWidth*/,
  gifHeight: gifHeight/*destGifHeight*/,
  images: imageArray/*an array contains imageData Object*/,
  frameDuration: 0.1/*gif frame interval*/,
  numWorkers: 1/*weixin miniprogram must be 1*/
}, function (obj) {
  console.log(obj);
  //obj.image a base64 link for gif
});

simple scale imageData

gifshot.Bilinear(imageData.data, imageData.width, imageData.height, destScaleX, destScaleY);
/* retrun {data: Uint8ClampedArray, width: destWidth, height: destHeight} */