Repository navigation
Propagate the error string of GIF processing for decode_gif - #16113
Merged
Merged
Conversation
…r `decode_gif` This fix tries to improve the error thrown by `decode_gif` to include the error string generated by GIF processing. Previously, the error was not very indicative as the error string returned by GIF processing was hidden: ``` .......... InvalidArgumentError (see above for traceback): Invalid GIF data, size 2091369 [[Node: DecodeGif = DecodeGif[_device="/job:localhost/replica:0/task:0/device:CPU:0"](ReadFile)]] ``` This fix propagate the error string to be part of the `InvalidArgumentError`: ``` InvalidArgumentError (see above for traceback): Invalid GIF data (size 2091369), can't process optimized gif [[Node: DecodeGif = DecodeGif[_device="/job:localhost/replica:0/task:0/device:CPU:0"](ReadFile)]] ``` This fix fixes 15838. Signed-off-by: Yong Tang <[email protected]>
Signed-off-by: Yong Tang <[email protected]>
rmlarsen
suggested changes
Jan 22, 2018
|
|
||
| uint8* Decode(const void* srcdata, int datasize, | ||
| std::function<uint8*(int, int, int, int)> allocate_output); | ||
| std::function<uint8*(int, int, int, int)> allocate_output, |
Contributor
There was a problem hiding this comment.
Please add a unit test for the new functionality.
so that error messages like `can't process optimized gif` are propagated to the exception of `InvalidArgumentError`. Signed-off-by: Yong Tang <[email protected]>
Member
Author
|
Thanks @rmlarsen for the review. A unit test |
rmlarsen
approved these changes
Jan 23, 2018
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.
This fix tries to improve the error thrown by
decode_gifto include the error string generated by GIF processing.Previously, the error was not very indicative as the error string
returned by GIF processing was hidden:
This fix propagate the error string (
can't process optimized gif) to be part of theInvalidArgumentError:This fix fixes #15838.
Signed-off-by: Yong Tang [email protected]