big updat:
- update dependencies - add webp support and webp conversion for profile images
This commit is contained in:
parent
19c3dbb42d
commit
95aaaa69ea
244 changed files with 121382 additions and 86 deletions
2
node_modules/super-image-cropper/dist/lib/synthetic-gif.js
generated
vendored
Normal file
2
node_modules/super-image-cropper/dist/lib/synthetic-gif.js
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";var e=require("gif-build-worker-js"),t=require("gif.js"),s=require("../index.js");exports.SyntheticGIF=class{cropperJsOpts;frames;frameDelays;gifJsOptions;outputType;constructor({frames:e,commonCropOptions:t,frameDelays:s,gifJsOptions:r={},outputType:i}){this.cropperJsOpts=t.cropperJsOpts,this.frames=e,this.frameDelays=s,this.gifJsOptions=r,this.outputType=i}bootstrap(){return new Promise(((r,i)=>{const o=e.transformToUrl(),p=Object.assign({workers:2,quality:10,workerScript:o,width:this.cropperJsOpts.width,height:this.cropperJsOpts.height,transparent:"transparent"},this.gifJsOptions||{}),a=new t(p);a.on("finished",(e=>{if(this.outputType===s.OutputType.BLOB)r(e);else if(this.outputType===s.OutputType.BASE64)r(this.convertBlob2Base64(e));else{const t=window.URL.createObjectURL(e);r(t)}})),this.frames.forEach(((e,t)=>{a.addFrame(e,{delay:this.frameDelays[t],copy:!0})})),a.render()}))}convertBlob2Base64(e){return new Promise(((t,s)=>{const r=new FileReader;r.onload=function(e){t(e?.target?.result)},r.onerror=e=>{s(e)},r.readAsDataURL(e)}))}};
|
||||
//# sourceMappingURL=synthetic-gif.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue