-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Python error reporting for ImageOutput and IB.set_pixels (#2127)
The underlying decoding of pixel value arrays -- used by some of the ImageOutput methods and ImageBuf.set_pixels -- threw exceptions when the pixel array didn't conform to expectations. This led to very confusing behavior, and crashes if the python program didn't carefully catch them. Instead of throwing exceptions, bubble up an error message for the usual OIIO error reporting, so wrongly-shaped pixel data arrays are treated similarly to other kinds of error. Also, detect with a better error message cases where user tries to write scanlines to a tiled file or vice versa -- it was handled well in C++, but the Python would start by parsing the pixel array, then have a confusing error that it was the wrong shape, instead of the more clear error message about using tiles instead of scanlines.
- Loading branch information
Showing
4 changed files
with
50 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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