wvanbergen / chunky_png

Read/write access to PNG images in pure Ruby.
https://chunkypng.com
MIT License
1.05k stars 101 forks source link

Version 1.3.7 makes happo fail #114

Closed trotzig closed 8 years ago

trotzig commented 8 years ago

I maintain a project called happo. We have a dependency on chunky png that looks like this in our gemspec file:

  s.add_runtime_dependency 'chunky_png', '~>1.3.1'

After 1.3.7 was released, we started seeing this in our builds:

      RuntimeError:
        /home/travis/build/Galooshi/happo/vendor/bundle/ruby/2.0.0/gems/chunky_png-1.3.7/lib/chunky_png/canvas/png_decoding.rb:120:in `decode_png_image_pass': wrong number of arguments (7 for 6) (ArgumentError)
            from /home/travis/build/Galooshi/happo/vendor/bundle/ruby/2.0.0/gems/chunky_png-1.3.7/lib/chunky_png/canvas/png_decoding.rb:120:in `decode_png_without_interlacing'
            from /home/travis/build/Galooshi/happo/vendor/bundle/ruby/2.0.0/gems/chunky_png-1.3.7/lib/chunky_png/canvas/png_decoding.rb:99:in `decode_png_pixelstream'
            from /home/travis/build/Galooshi/happo/vendor/bundle/ruby/2.0.0/gems/chunky_png-1.3.7/lib/chunky_png/canvas/png_decoding.rb:81:in `from_datastream'
            from /home/travis/build/Galooshi/happo/vendor/bundle/ruby/2.0.0/gems/chunky_png-1.3.7/lib/chunky_png/image.rb:74:in `from_datastream'
            from /home/travis/build/Galooshi/happo/vendor/bundle/ruby/2.0.0/gems/chunky_png-1.3.7/lib/chunky_png/canvas/png_decoding.rb:36:in `from_blob'
            from /home/travis/build/Galooshi/happo/lib/happo/runner.rb:124:in `block (2 levels) in <top (required)>'
            from /home/travis/build/Galooshi/happo/lib/happo/runner.rb:83:in `each'
            from /home/travis/build/Galooshi/happo/lib/happo/runner.rb:83:in `block in <top (required)>'
            from /home/travis/build/Galooshi/happo/lib/happo/runner.rb:74:in `each'
            from /home/travis/build/Galooshi/happo/lib/happo/runner.rb:74:in `<top (required)>'
            from /home/travis/build/Galooshi/happo/bin/happo:22:in `require'
            from /home/travis/build/Galooshi/happo/bin/happo:22:in `block in <main>'
      # ./spec/happo_spec.rb:55:in `block in run_happo'
      # ./spec/happo_spec.rb:49:in `chdir'
      # ./spec/happo_spec.rb:49:in `run_happo'
      # ./spec/happo_spec.rb:679:in `block (3 levels) in <top (required)>'

https://github.com/Galooshi/happo

wvanbergen commented 8 years ago

Weird. decode_png_image_pass definitely requires 7 arguments now. This was previously 6.

However, the 2 locations where this method is called are both updated to have the 7th argument.

Are you overriding decode_png_image_pass somewhere in your code?

wvanbergen commented 8 years ago
bootstraponline commented 8 years ago

eyes_selenium was also broken by this API change.

lencioni commented 8 years ago

I don't think we are overriding anything from chunky png. If it is helpful, this is the line that seems to cause this problem: https://github.com/Galooshi/happo/blob/ce49454700aecfede3950298bf85d25ac7b34658/lib/happo/runner.rb#L124

screenshot = ChunkyPNG::Image.from_blob(driver.screenshot_as(:png))

We are using oily png, which does redefine this method. I think that probably needs to be updated at the same time.

wvanbergen commented 8 years ago

This should be fixed by using oily_pong version 1.2.1