Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tev crashes with pgm files that contain comments #86

Open
vchizhov opened this issue Jan 15, 2020 · 4 comments
Open

tev crashes with pgm files that contain comments #86

vchizhov opened this issue Jan 15, 2020 · 4 comments

Comments

@vchizhov
Copy link

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.

@Tom94
Copy link
Owner

Tom94 commented Jan 15, 2020

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.

@vchizhov
Copy link
Author

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.

@Tom94
Copy link
Owner

Tom94 commented Jan 15, 2020

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.

@vchizhov
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants