meltingice/CamanJS — pull request #29 by yannickcr (2012-08-23 06:39:21+00:00)
Title: Fix the filters under Opera, fix #8

Hello,

After a few hours of investigation, I found that the problem seems to come from the Calculate.bezier method.

It works fine during the first call and fail on the second.

You can try :

```javascript
Caman("home-example-original.jpg", "#example-canvas", function () {
this.exposure(15) // First call of Calculate.bezier (pass)
.exposure(15).render(); // Second call of Calculate.bezier (fail)
});
```
Demo available here: http://jsfiddle.net/Country/f9pZQ/

Since it works if the developer tools of Opera are activated (JIT off) I just logged the variables in textareas for debugging.

If you use Opera you can see there is an error during the calculation of Ax during the second call.

This is very weird since the variables used for the calculation seems ok, it looks like a signed/unsigned number problem. By why only during the second call ? And why does it works if the JIT is off ? I don't know.

Even so I was able to resolve the bug using parseInt() on the result of the Cx calculation. (Another solution is to set Ax to null just before the calculation).

Here's a demo of the fixed build: http://jsfiddle.net/Country/gZYAh/