You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it's so easy to misuse and ignore return code, just like in C.
Why not throw on error, with an FileException error that has a path field?
If the bool return was the make the function nothrow, i don't think that's a good justification: in terms of performance, the cost of whatever imwrite is doing will dwarf exception handling anyways.
It's also more idiomatic, safe, can show more context, easier to use, etc.
EDIT:
also, it would make it more consistent with imread which throws ImageIOException and doesn't have C-like return error codes
The text was updated successfully, but these errors were encountered:
this doesn't look very idiomatic, looks more like C-ism.
it's so easy to misuse and ignore return code, just like in C.
Why not throw on error, with an FileException error that has a path field?
If the
bool return
was the make the function nothrow, i don't think that's a good justification: in terms of performance, the cost of whatever imwrite is doing will dwarf exception handling anyways.It's also more idiomatic, safe, can show more context, easier to use, etc.
EDIT:
also, it would make it more consistent with imread which throws
ImageIOException
and doesn't have C-like return error codesThe text was updated successfully, but these errors were encountered: