Git Product home page Git Product logo

cropperjs-gif's Introduction

cropperjs-gif

support cropperjs to crop gif

easy-gif-js

simple wrapper for gif.js and gifuct-js

Fix some older browser error:

1.Blob constructor error.
2.UInt8ClamedArray not defiend error.
3.CanvasPixelArray not work in Worker.

demo

cropperjs-gif
easy-gif-js

build

1.npm install bower
2.npx bower install
3.npm run build

debug

1.npm run serve
2.access [cropperjs-gif] (http://127.0.0.1/demo/index.html) [easy-gif-js] (http://127.0.0.1/demo/gif.html)

license

MIT

cropperjs-gif's People

Contributors

ddulhddul avatar wmlgl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cropperjs-gif's Issues

when cropping rotated area, it crops different area

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;

和项目无关,想到一个截gif的好实现

利用OSS的图像处理.
实测阿里云支持对gif截取处理.

截图上传时,检测到gif时,不做canvas处理,获取到用户选择的坐标尺寸,然后直接上传原图到OSS,保存图片链接时,按照OSS的格式,将截图坐标附上即可


test.gif保存为test.gif?x-oss-process=image/crop,x_50,y_50,w_100,h_100

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.