Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hangs with intensities < 1 #22

Closed
Bengt opened this issue Oct 11, 2012 · 3 comments
Closed

Hangs with intensities < 1 #22

Bengt opened this issue Oct 11, 2012 · 3 comments

Comments

@Bengt
Copy link
Contributor

Bengt commented Oct 11, 2012

Noisy will hang and consume as much CPU circles, as a available for intensities < 1 on certain sizes. Firefox (15) will ask to stop the script, Chrome (22) will sometimes notice for unresponsive tabs an offer to stop it, sometimes Chrome will just keep the script running till the tab is closed. Opera (12) also just keeps going, until the tab is closed.

I isolated this as a minimal test case:

<html>
    <body>
        <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
        <script src="http://cdnjs.cloudflare.com/ajax/libs/noisy/1.1/jquery.noisy.min.js"></script>
        <script>
            $('body').noisy({
                'intensity' : 0.234,
                'size' : 100,
                'opacity' : 0.123,
                'fallback' : '',
                'monochrome' : true
            }).css('background-color', '#eaeaea');
        </script>
    </body>
</html>

I ran these tests to isolate intensity as the cause:

'size' : 99 hangs
'size' : 100 works
'size' : 101 hangs
'size' : 99 , 'intensity : '1.0 works
'size' : 100 , 'intensity' : '1.0 works
'size' : 101, 'intensity' : '1.0 works
'size' : 99, 'opacity : '1.0 hangs
'size' : 100, 'opacity : '1.0 works
'size' : 101, 'opacity : '1.0 hangs

DanielRapp added a commit that referenced this issue Oct 11, 2012
Silly bug. Stemmed from only having tested multiples of 100 for the size option.
DanielRapp added a commit that referenced this issue Oct 11, 2012
DanielRapp added a commit that referenced this issue Oct 11, 2012
DanielRapp added a commit that referenced this issue Oct 11, 2012
DanielRapp added a commit that referenced this issue Oct 11, 2012
DanielRapp added a commit that referenced this issue Oct 11, 2012
@DanielRapp
Copy link
Owner

That was a silly bug.
It was getting stuck in an infinite loop when number of pixels (size * intensity) wasn't a whole number.
Thank you for letting me know, and for the excellent bug report.

@Bengt
Copy link
Contributor Author

Bengt commented Oct 11, 2012

Great, thanks for fixing this so quickly.

@Bengt
Copy link
Contributor Author

Bengt commented Oct 11, 2012

Since this was quite a severe bug and and the last pull to cdnjs/cdnjs was a year ago, would this be worth a release? Perhaps a bugfix release called 1.1.1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants