-
Notifications
You must be signed in to change notification settings - Fork 101
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
Face with "NoMethodError: undefined method `-' for nil:NilClass" error if compare images with NO DIFFERENCES #125
Comments
The error is coming from your own code ( If you can provide a snippet of code that reproduces it, I can look into it |
Closing this due to missing information. Feel free to reopen if the problem persists and you can provide more information. |
@wvanbergen I ran into this too. It was caused by trying to compare identical images. @kay4444's implementation does not have a catch for Thanks for this awesome gem 👍 chunky_png is great! |
Can you share the full stack trace of the error? |
Hi @wvanbergen, here is an A/B test(using identical images). The first is the code with a conditional to catch identical images and the 2nd example is the way that @kay4444 implemented the code above.
Outputs:
Here is the intial implementation:
Returns the following error:
I think this is caused by the attempt to draw a rectangle with no data. Thanks again for this module, it has helped me immensely! |
The problem is that you are sending a |
When I try to compare images with no differences I face with "NoMethodError: undefined method `-' for nil:NilClass" error. I Use Windows 7 OS. Please see screenshot from my project.
But if I compare images with differences - no errors are shown.
The text was updated successfully, but these errors were encountered: