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

Infinite loop if image doesn't have at least 4 colors #13

Open
oliversalzburg opened this issue Jun 19, 2015 · 4 comments
Open

Infinite loop if image doesn't have at least 4 colors #13

oliversalzburg opened this issue Jun 19, 2015 · 4 comments
Assignees
Labels

Comments

@oliversalzburg
Copy link

I tried to load our company logo and it crashed the page. Apparently the script tries to find at least 4 colors.

@maaaaark
Copy link

I ran into this bug as well with the gradify.py script. My cpu started running at 100% and the process just kept running indefinitely. A stack trace shows that the script is getting hung up here:
in get_RGB_diff return abs(1.4*abs(old[0]-new[0])**(1/2.0) + .8*abs(old[1]-new[1])**(1/2.0) + .8*abs(old[2]-new[2])**(1/2.0))**(1/2.0)

Here's the image I am using:
clothing

@fraser-hemp
Copy link
Owner

@maaaaark I ran it on gradifycss.com and it produced a gradient correctly

@fraser-hemp fraser-hemp self-assigned this Jun 21, 2015
@fraser-hemp
Copy link
Owner

@oliversalzburg I've temporarily coded an early exit for photos with less than 4 colors; after exams I will include code that creates gradients for [1-2] colors.

@maaaaark
Copy link

@fraser-hemp Ok, it looks like my problem was due to me changing the black_sensitivity argument's value in the __init__ method. I set it back to 4.3 and it works fine. Apologies for cluttering up this issue.

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

No branches or pull requests

3 participants