wmlgl / cropperjs-gif Goto Github PK
View Code? Open in Web Editor NEWsupport cropperjs to crop gif, and a simple wrapper for gif.js and gifuct-js
support cropperjs to crop gif, and a simple wrapper for gif.js and gifuct-js
Thanks for gif cropperjs lib it helps me a lot in my project,
but I found an issue about rotated area crop.
after cropper.rotate(-45)
,
cropped blob area is not matched with canvas
I think this is cause of setupCanvas function's rotated box check
var rotatedBoxWidth = (this.width*Math.cos(radian)+this.height*Math.sin(radian)) * limitRatio;
var rotatedBoxHeight = (this.height*Math.cos(radian)+this.width*Math.sin(radian)) * limitRatio;
var rotatedBoxWidth = (this.widthMath.cos(radian)+this.heightMath.sin(radian)) * limitRatio;
利用OSS的图像处理.
实测阿里云支持对gif截取处理.
截图上传时,检测到gif时,不做canvas处理,获取到用户选择的坐标尺寸,然后直接上传原图到OSS,保存图片链接时,按照OSS的格式,将截图坐标附上即可
如
test.gif
保存为test.gif?x-oss-process=image/crop,x_50,y_50,w_100,h_100
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.