chjj / ttystudio

A terminal-to-gif recorder minus the headaches.
Other
3.24k stars 93 forks source link

"TypeError: Value is out of bounds" when writing frame 1 #10

Closed bedekelly closed 9 years ago

bedekelly commented 9 years ago

Output:

 ~  ttystudio myfile.gif --log
initializing writer
writing image
writing head
writing frame 0 - 59 left
frame dimensions: 640x336
writing frame 1 - 58 left
frame dimensions: 1x1
TypeError: value is out of bounds
    at TypeError (<anonymous>)
    at checkInt (buffer.js:705:11)
    at Buffer.writeUInt8 (buffer.js:715:5)
    at GIFWriter.write8 (/usr/local/lib/node_modules/ttystudio/lib/gif.js:82:7)
    at GIFWriter.writeFrame (/usr/local/lib/node_modules/ttystudio/lib/gif.js:196:12)
    at GIFWriter.write (/usr/local/lib/node_modules/ttystudio/lib/gif.js:61:10)
    at SGRWriter.write (/usr/local/lib/node_modules/ttystudio/lib/writer.js:53:22)
    at compile (/usr/local/lib/node_modules/ttystudio/bin/ttystudio:61:10)
    at /usr/local/lib/node_modules/ttystudio/bin/ttystudio:93:12
    at Screen.done (/usr/local/lib/node_modules/ttystudio/lib/record.js:93:7)

Replicated this error in urxvt and gnome-terminal, with different terminal sizes that definitely weren't 1x1.

rosshettel commented 9 years ago

Also getting the same error on OS X in iTerm.

✘  ~  ttystudio cowsay.gif --log initializing writer writing image writing head writing frame 0 - 71 left frame dimensions: 824x504 writing frame 1 - 70 left frame dimensions: 1x1 TypeError: value is out of bounds at TypeError (<anonymous>) at checkInt (buffer.js:705:11) at Buffer.writeUInt8 (buffer.js:715:5) at GIFWriter.write8 (/Users/rosshettel/node_modules/ttystudio/lib/gif.js:82:7) at GIFWriter.writeFrame (/Users/rosshettel/node_modules/ttystudio/lib/gif.js:196:12) at GIFWriter.write (/Users/rosshettel/node_modules/ttystudio/lib/gif.js:61:10) at SGRWriter.write (/Users/rosshettel/node_modules/ttystudio/lib/writer.js:53:22) at compile (/Users/rosshettel/node_modules/ttystudio/bin/ttystudio:61:10) at /Users/rosshettel/node_modules/ttystudio/bin/ttystudio:93:12 at Screen.done (/Users/rosshettel/node_modules/ttystudio/lib/record.js:93:7)

chjj commented 9 years ago

This is a side effect of the gif optimization. I'm going to revert it right now and republish. Sorry about that.

Very important: Could either of you give me a gist of your cowsay/myfile.frames.json? This would help solve the issue with the optimizer.

chjj commented 9 years ago

ttystudio v0.0.4 (just published) should fix this for now. Optimization has been disabled. I would really appreciate if I could have a frames.json from either of you that replicates this.

jfinstrom commented 9 years ago

https://gist.githubusercontent.com/jfinstrom/fe188a0b39711e960c93/raw/file.frames.json

chjj commented 9 years ago

@jfinstrom, thank you. That helped me figure it out very quickly. Sadly, it was a 1 character typo causing the issue. The fix is now published to npm. Thanks guys.