Process libjpeg errors the OpenCV way#3314
Closed
mollierobbert wants to merge 1 commit intoopencv:2.4from
mollierobbert:patch-1
Closed
Process libjpeg errors the OpenCV way#3314mollierobbert wants to merge 1 commit intoopencv:2.4from mollierobbert:patch-1
mollierobbert wants to merge 1 commit intoopencv:2.4from
mollierobbert:patch-1
Conversation
Contributor
|
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. |
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Errors from libjpeg, specifically "Corrupted JPEG data" messages, are printed to
stderrby the default error handler, making those errors uncatchable. By overwriting theoutput_messagemethod as suggested by the libjpeg docs we can handle those errors like regular OpenCV errors.