Open vchizhov opened 4 years ago
Hi there! Thanks for letting me know. Can you provide sample files for me to test? Ideally, one PGM without a comment that works and another one with a comment that doesn't work.
You can find two images here: https://drive.google.com/open?id=1xIhlVBwbFfgehWgAO-7YHJ_YgsgUeZ1x
The _no_comment image
is exactly the same as the other, but with the comments removed. Both work fine in IrfanView on Windows and xv on Linux.
Thanks for the images!
It appears that stb_image, the underlying library responsible for loading PGM images, does not support comments---see here. Unfortunately, I can't do much about that until I maybe get some time to implement my own PGM decoder---which doesn't actually look extremely involved. Best bet is to create an issue over at the stb_image repo.
That said, tev really should handle this more gracefully... stb_image gives tev a 0x0 image upon trying to load the PGM, which leads to a crash. This is something I'll definitely address.
Thank you for looking into it. I submitted an issue with stb, hopefully that gets handled (unfortunately my current workload does not allow me the time to go and fix it myself), since I am also using stb_image in some probjects.
If I have comments
# some comment here
in a pgm file, tev crashes upon trying to open it. It works fine with pgm files not containing comments however.