Comments (6)
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?
- https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage#Exceptions_thrown
- https://stackoverflow.com/questions/19338032/canvas-indexsizeerror-index-or-size-is-negative-or-greater-than-the-allowed-a
from elm-canvas.
Seems to be Firefox problem=) Thanks for the links! I'll try solutions from the last link!
from elm-canvas.
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.
from elm-canvas.
Accedentally closed the issue. I'll try to create Ellie project!
from elm-canvas.
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.
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)
- clearrect for transparent background HOT 1
- Improve transform docs
- Improve arc docs
- Document the canvas coordinate system
- Add making textures from DOM images HOT 1
- Canvases get blank on deleting one of them from a List HOT 2
- High CPU load with many canvases HOT 7
- Sampling Canvas Data (getImageData) HOT 3
- Text Color Support HOT 1
- Use `Result` rather than `Maybe` for texture loading HOT 1
- Use elm-geometry types? HOT 1
- Support for "groups" or similar batching of settings to multiple `Renderable` HOT 4
- Runtime crash with `arc` function and negative radius
- Regression: text without fill or stroke is rendered with both fill and stroke
- Not working HOT 3
- Unexpected scene HOT 1
- Question about filter HOT 1
- Please support `roundRect` HOT 2
- Margin bug: canvas and elm-canvas don't share the same height HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-canvas.