Comments (4)
OK, sorry, no, that doesn't work either.
This is the issue:
I load a svg into the ctx canvas.
//load planet image
planet.ready = false;
planet.image = new Image();
planet.image.onload = function () {
planet.ready = true;
};
This is the code that initializes the drawing and draws the image into the canvas
//draw planet
if (planet.ready)
{
ctx.drawImage(planet.image, planet.x-planet.r, planet.y-planet.r,planet.r*2,planet.r*2);
}
else
{
alert('Image not loaded');
ctx.arc(planet.x,planet.y,planet.r,0,Math.PI*2);
ctx.fill();
}
//trajectory drawing start
ctx.strokeStyle="#FF0000";
ctx.beginPath();
ctx.moveTo(satellite.x,satellite.y);
At first my program doesn't load it I don't know why, so the svg isnt loaded into the canvas and the circle is drawn instead. In that case the gif recording works fine.
After a second if I hit my "reset" button the svg is loaded and everything is redrawn, with svg into the canvas. Then the gif recording fails.
Already tested and the issue isn't with the transformations or the lack of setSize.
from jsgif.
Aaaand... I got the workoround and the possible problem. The scripts and the SVG are in a folder in the local disk. If you try to do a getImage on a canvas that has an image from a different domain, Chrome gives security error. Also, all local files (file://) are treated as external, so, getImage has that error. Jsgif has a getImage for the passed canvas context and is probably hitting that error. Problem is the whole procedure is in a try-catch block so we don't get to know what's going on.
A workaround is to run chrome.exe --allow-file-access-from-files
from jsgif.
Maybe my pull request might be worth a try.
#34
By default the sampling factor is 10 which means not all pixels serve as input for the neural net in NeuQuant.js. This way pixel colours can be lost. Setting it to 1 will ensure that the network is learning from every pixel
from jsgif.
Related Issues (20)
- No license information HOT 1
- `addFrame` with `is_imageData=true` makes Chrome hang up HOT 3
- Writing canvas to GIF outputs double speed GIF HOT 1
- License HOT 1
- last frame of addFrame is not added to gif HOT 1
- Data URI generates a black gif HOT 4
- jsapng? can you make convas into animated PNG? HOT 5
- Animated Gif comes out black w/ Web Workers HOT 6
- Pixel width black line on left edge of GIF
- Add git tag
- My webcam snapshot is being overlay by the gif ??
- No plugin.xml file
- Color Reproduction Issue HOT 2
- Fixes report HOT 1
- Global color map HOT 2
- Crashes at 300+ Frames HOT 2
- License? HOT 2
- The encoding of the Gif fails depending on the size of the canvas HOT 1
- Background image shown in canvas but not in image output HOT 7
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 jsgif.