Png Output Fails
andyl opened this issue · comments
I run "theseus -w 20 -H 20 -f png -o maze"
And get the error message:
.rvm/gems/ruby-1.9.2-p0@theseus/gems/chunky_png-0.12.0/lib/chunky_png/color.rb:85:in from_hex': Not a valid hex color notation: 4294967295! (ChunkyPNG::ExpectationFailed) from .rvm/gems/ruby-1.9.2-p0@theseus/gems/theseus-1.0.1/lib/theseus/formatters/png.rb:73:in
block in initialize'
Platform: Ubuntu 10.10
I can't duplicate this, but I have an idea of what the problem is. Could you try changing line #73 of theseus/formatters/png.rb from "unless Fixnum" to "if String"? I think the issue is that I'm on a 64-bit system, so 0xFFFFFFFF is a Fixnum, but on 32-bit systems I think it's actually a Bignum.
I am on a 32 bit system - your edit fixed the problem - tx Andy
Excellent, thanks for testing that. I've pushed a fix and released 1.0.2.
You can use the Integer class to cover both Fixnum and Bignum. This is what I usein ChunkyPNG.