mattn / longcat

Looooooooooooooooooooooooooooooooooooooooooooooong cat
MIT License
664 stars 26 forks source link

Prevent iTerm2 from displaying broken_image.png instead of long cats #22

Closed yoichi closed 5 years ago

yoichi commented 5 years ago

On iTerm2, longcat -n 190 shows a longcat, but longcat -n 191 shows broken_image.png instead of a pretty longcat.

スクリーンショット 2019-09-27 22 57 15

Because iTerm2 processes an image with size smaller than

static const CGFloat kMaxDimension = 10000;

in https://github.com/gnachman/iTerm2/blob/master/sources/iTermImage.m. (iTerm2 debug log says "iTermImage.m:276 (-[iTermImage initWithJson:]): Bogus size {126, 10033}")

This is a workaround for it by resizing image not to exceed the threshold.

Regards,

mattn commented 5 years ago

Thank you.