Closed ghost closed 11 years ago
Editing RenderJob to log the canvas ID for each filter applied, I get something like this:
[16:00:04.853] Filter brightness finished for canvas 0! @ http://0.0.0.0:8000/dist/caman.full.js:1311
[16:00:05.282] Filter curves finished for canvas 1! @ http://0.0.0.0:8000/dist/caman.full.js:1311
[16:00:05.328] Filter saturation finished for canvas 0! @ http://0.0.0.0:8000/dist/caman.full.js:1311
[16:00:05.710] Filter gamma finished for canvas 1! @ http://0.0.0.0:8000/dist/caman.full.js:1311
[16:00:05.797] Filter vignette finished for canvas 0! @ http://0.0.0.0:8000/dist/caman.full.js:1311
[16:00:05.918] Filter brightness finished for canvas 1! @ http://0.0.0.0:8000/dist/caman.full.js:1311
[16:00:05.986] Filter brightness finished for canvas 0! @ http://0.0.0.0:8000/dist/caman.full.js:1311
[16:00:06.433] Filter curves finished for canvas 1! @ http://0.0.0.0:8000/dist/caman.full.js:1311
[16:00:06.476] Filter saturation finished for canvas 0! @ http://0.0.0.0:8000/dist/caman.full.js:1311
[16:00:06.810] Filter gamma finished for canvas 1! @ http://0.0.0.0:8000/dist/caman.full.js:1311
[16:00:06.920] Filter vignette finished for canvas 0! @ http://0.0.0.0:8000/dist/caman.full.js:1311
[16:00:07.043] Filter brightness finished for canvas 1! @ http://0.0.0.0:8000/dist/caman.full.js:1311
Apparently all of the render jobs get added to one global render queue, with no record of which canvas they're actually supposed to work on. Then the two Caman instances take turns popping jobs off the global queue and executing them on their own canvas. So instead of executing jobs 123456 and ABCDEF, they execute 135ACE and 246BDF.
Presumably each instance should have its own render queue?
When I apply a complicated filter to more than one image, I get incorrect results. It looks like CamanJS is getting the dimensions of the images mixed up, causing problems with (at least) the vignette filter.
If I chain all the callbacks so that images render sequentially, I get correct results - but it's awkward. Any idea what's going on?
The rendered output then looks like: