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

About comparison two large size png #84

Closed
ghost opened this issue Mar 2, 2015 · 4 comments
Closed

About comparison two large size png #84

ghost opened this issue Mar 2, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 2, 2015

I use iPad to take a screenshot and save as png image.
Its size is about 1.3M.
When I run the code below:
images.first.height.times do |y|
images.first.row(y).each_with_index do |pixel, x|
diff << [x,y] unless pixel == images.last[x,y]
end
end

There will be an error "out of bound " or sth.
Sorry I cannot remember the detail error message.
How can I solve this issue.

@wvanbergen
Copy link
Owner

Can you run this again, and paste the error message plus the stack trace here?

@ghost
Copy link
Author

ghost commented Mar 9, 2015

I ran it again and paste the error message here:

/Library/Ruby/Gems/2.0.0/gems/chunky_png-1.3.4/lib/chunky_png/canvas.rb:334:in assert_xy!': Coordinates (768,0) out of bounds! (ChunkyPNG::OutOfBounds) from /Library/Ruby/Gems/2.0.0/gems/chunky_png-1.3.4/lib/chunky_png/canvas.rb:174:in[]'
from diff.rb:49:in block (2 levels) in <main>' from diff.rb:48:ineach'
from diff.rb:48:in each_with_index' from diff.rb:48:inblock in

'
from diff.rb:47:in times' from diff.rb:47:in'

@wvanbergen
Copy link
Owner

Most likely, the two images you're using do not have the same dimensions. So the x coordinate you get from the first image is too high for the last image. Mind sharing the two images?

@ghost
Copy link
Author

ghost commented Mar 10, 2015

Thank you for your help.
You are right the dimensions are not same.
I think QA team take the screenshot by different ipads.
I think it can be closed now.

@ghost ghost closed this as completed Mar 10, 2015
This issue was closed.
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

1 participant