Open asrabon opened 4 years ago
@asrabon Could you demonstrate examples or cases in which an exception needs to be raised? It will be helpful for me to refine the codes if I know the cases.
I can give you some more examples if you need them but these should give you a general idea of what I am talking about:
It would be nice everywhere libjpeg throws an ERREXIT of any kind it returned a python exception or error code rather than terminating the entire program by calling the exit function in C. If you wanted a trivial script you could run to see one example of the unrecoverable program termination.
from jpegio import read
jpeg = read("/path/to/some/file.gif") print("Will never reach this print statement.")
@asrabon Thanks for your explanation. I am gonna try dealing with it .
Is there anyway to make the jpegio return a exception if it breaks in the libjpeg library? Currently if you try to read a jpeg that it can not parse properly or is not actually a jpeg file it will kill the entire program without being able to recover.