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

Process libjpeg errors the OpenCV way #3314

Closed
wants to merge 1 commit into from
Closed

Process libjpeg errors the OpenCV way #3314

wants to merge 1 commit into from

Conversation

mollierobbert
Copy link

Errors from libjpeg, specifically "Corrupted JPEG data" messages, are printed to stderr by the default error handler, making those errors uncatchable. By overwriting the output_message method as suggested by the libjpeg docs we can handle those errors like regular OpenCV errors.

@vpisarev vpisarev self-assigned this Oct 8, 2014
@vpisarev
Copy link
Contributor

vpisarev commented Oct 8, 2014

currently when some jpeg is corrupted, OpenCV returns empty image. With the proposed patch the program will crash if there is no "catch() {}" statement. I'm sure, many people will not like such a change, especially in the stable version. This patch can not be accepted, sorry.

@PatWie
Copy link

PatWie commented Oct 20, 2016

And how to handle these cases? Any verify function? I think this is an important issue! I still observe this issue in OpenCV 3.1. Please reopen. Currently there is no way to detect these corrupted images using imread in python.

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

Successfully merging this pull request may close these issues.

3 participants