Giter Site home page Giter Site logo

Comments (6)

joakin avatar joakin commented on July 21, 2024

The Elm and JS library should be deterministic. You say:

Often that breaks elm app in Firefox. Sometimes works ok.

That doesn't sound deterministic at all.

Are your images sizes valid? Check on them before sending them to elm, the width and height. Maybe it is this: https://bugzilla.mozilla.org/show_bug.cgi?id=1497275

Maybe this helps?

from elm-canvas.

shepelevstas avatar shepelevstas commented on July 21, 2024

Seems to be Firefox problem=) Thanks for the links! I'll try solutions from the last link!

from elm-canvas.

shepelevstas avatar shepelevstas commented on July 21, 2024

Looks like DOM Image fails to be decoded at first try for every new image. I load two files, three times the first and then three times the second. For each file the first load results in TImage with height and width equal 0. Then drawImage command fails in Firefox.
Capture

from elm-canvas.

shepelevstas avatar shepelevstas commented on July 21, 2024

Accedentally closed the issue. I'll try to create Ellie project!

from elm-canvas.

joakin avatar joakin commented on July 21, 2024

Seems like you may have problems in the JS.

Just to be clear, fromDomImage requires a image instance from the JS Image constructor, and defined width and height properties because there are necessary for Texture.dimensions.

from elm-canvas.

shepelevstas avatar shepelevstas commented on July 21, 2024

Yes, you are right! While creating Ellie example, I've noticed that in one of the functions that downscale the image - image was returned right after image.src = canvas.toDataURL(). I refactored it into a Promise and the error is gone! =D
I wonder how come Chrome and Safari never stumble on it =))
Thanks you for your help! You suggested creating an Ellie example in another issue, and it helped me to find the error!
And thank you for this great elm package! Works great and easy to use =D

from elm-canvas.

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.