Skip to content

Commit

Permalink
fix(IBA): Improve error message for IBA::ocio functions (#3887)
Browse files Browse the repository at this point in the history
If colorconvert, ociolook, ociodisplay, ociofiletransform fail
because OCIO support is not enabled, make sure the error message
makes that clear.

Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz authored Jun 17, 2023
1 parent bdf31de commit 612bbbd
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions src/libOpenImageIO/color_ocio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1989,8 +1989,15 @@ ImageBufAlgo::colorconvert(ImageBuf& dst, const ImageBuf& src, string_view from,
if (colorconfig->error())
dst.errorfmt("{}", colorconfig->geterror());
else
dst.errorfmt("Could not construct the color transform {} -> {}",
from, to);
#ifdef USE_OCIO
dst.errorfmt(
"Could not construct the color transform {} -> {} (unknown error)",
from, to);
#else
dst.errorfmt(
"Could not construct the color transform {} -> {} (no OpenColorIO support)",
from, to);
#endif
return false;
}
}
Expand Down Expand Up @@ -2300,7 +2307,13 @@ ImageBufAlgo::ociolook(ImageBuf& dst, const ImageBuf& src, string_view looks,
if (colorconfig->error())
dst.errorfmt("{}", colorconfig->geterror());
else
dst.errorfmt("Could not construct the color transform");
#ifdef USE_OCIO
dst.errorfmt(
"Could not construct the color transform (unknown error)");
#else
dst.errorfmt(
"Could not construct the color transform (no OpenColorIO support)");
#endif
return false;
}
}
Expand Down Expand Up @@ -2359,7 +2372,13 @@ ImageBufAlgo::ociodisplay(ImageBuf& dst, const ImageBuf& src,
if (colorconfig->error())
dst.errorfmt("{}", colorconfig->geterror());
else
dst.errorfmt("Could not construct the color transform");
#ifdef USE_OCIO
dst.errorfmt(
"Could not construct the color transform (unknown error)");
#else
dst.errorfmt(
"Could not construct the color transform (no OpenColorIO support)");
#endif
return false;
}
}
Expand Down Expand Up @@ -2435,7 +2454,13 @@ ImageBufAlgo::ociofiletransform(ImageBuf& dst, const ImageBuf& src,
if (colorconfig->error())
dst.errorfmt("{}", colorconfig->geterror());
else
dst.errorfmt("Could not construct the color transform");
#ifdef USE_OCIO
dst.errorfmt(
"Could not construct the color transform (unknown error)");
#else
dst.errorfmt(
"Could not construct the color transform (no OpenColorIO support)");
#endif
return false;
}
}
Expand Down

0 comments on commit 612bbbd

Please sign in to comment.