Giter Site home page Giter Site logo

Comments (12)

jnordberg avatar jnordberg commented on September 14, 2024 1

You need to set the workerScript url if it's not in the same dir as the page

from gif.js.

ionull avatar ionull commented on September 14, 2024 1

@1j01 thanks a lot, I used file loader minutes ago, it is now working well :) Blob is not compatible well with some IE browser

from gif.js.

jnordberg avatar jnordberg commented on September 14, 2024

Probably due to you running it from disk instead of a web server

from gif.js.

vincerubinetti avatar vincerubinetti commented on September 14, 2024

Not the case. Thank you for the prompt response, and I apologize for the lack of detail. Was writing this very late at night and exhausted.

See here: http://vincentrubinetti.com/apps/test/Gyrographer.html Press "Export Animated GIF" and look in the console.

Here's my set up:

animate step function
{
animate step++
draw new canvas
add frame with gif.js
if animate done
{
render gif.js
}
else
{
setTimeout this step function 10 ms
}
}

It might have something to do with the htaccess... I'll fool around with that.

from gif.js.

vincerubinetti avatar vincerubinetti commented on September 14, 2024

I did:

encoder = new GIF({width: Canvas.width, height: Canvas.height, workers: 2, quality: 10, workerScript: 'App/gif'});

Does it have to be an absolute path?

from gif.js.

jnordberg avatar jnordberg commented on September 14, 2024

it needs to be a url to the actual script, not the directory it resides in

from gif.js.

vincerubinetti avatar vincerubinetti commented on September 14, 2024

Very good, got it working. Thank you! Perhaps you should make that clear in the workerScript description in the readme to avoid future confusion.

from gif.js.

jnordberg avatar jnordberg commented on September 14, 2024

It's pretty clear already IMHO

from gif.js.

ionull avatar ionull commented on September 14, 2024

@jnordberg Is there any suggestion to use it in a webpack project(like vuejs), since it is a one-js-file project.

from gif.js.

jnordberg avatar jnordberg commented on September 14, 2024

@ionull No, not really. The worker script is loaded through the browsers loading system, maybe that can be monkeypatched to do something but i doubt it.

from gif.js.

ionull avatar ionull commented on September 14, 2024

@jnordberg I found something like worker-loader workerjs project which will load worker from file. But in gif.js project we must use a file path instead of worker instance.

from gif.js.

1j01 avatar 1j01 commented on September 14, 2024

See #58, #47; @ZigGreen was able to load the worker with a blob URL.
You could use webpack-contrib/raw-loader or similar to dynamically inline the file in the resulting bundle.

from gif.js.

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.