Giter Site home page Giter Site logo

Comments (4)

antimatter15 avatar antimatter15 commented on July 24, 2024

You can't add raw image URLs with addFrame which expects a canvas object. One way to do this is by creating a canvas context and calling drawImage with the data URL

Sent from my iPhone

On Jun 19, 2014, at 11:12 AM, kinduff [email protected] wrote:

If I add a frame with a Data URI it generates a black gif.

To reproduce

Modify clock.html demo at line 127:

uridata = canvas.toDataURL('image/png');
encoder.addFrame(uridata, true);
Data URI is generated good, you can see it if you add console.log(uridata) and the end.

Did I missed something from the docs, tho?


Reply to this email directly or view it on GitHub.

from jsgif.

kinduff avatar kinduff commented on July 24, 2024

@antimatter15 I read at the README file that:

You can set the second parameter to true and pass a imageData.data-esque array as your first argument.

How can I generate this imageData.data-esque?

from jsgif.

leeoniya avatar leeoniya commented on July 24, 2024

my guess is

var fauxImageData = {
    width: 320,
    height: 75,
    data: [...],                      // `Uint8Array` or `Uint8ClampedArray` of subpixels
};

from jsgif.

kinduff avatar kinduff commented on July 24, 2024

@leeoniya Thanks!

from jsgif.

Related Issues (20)

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.