Skip to content

Commit ddba92f

Browse files
authored
fix(oiiotool): be cautious promoting to float due to color space name with --autocc (#5192)
Background: OCIO 1.x configs were LUT based and so tended to have different color space names for different data types/bit depths. We capitalized on this to let `oiiotool --autocc` also select type/bits, but this trick doesn't work so well for OCIO 2.x configs with procedural (non-LUT) transformations that all look like "float". We don't want to promote to float just because of this! Solution: When using color space data type (nearly always float for new configs and certainly the built-in configs) to infer output, DO NOT use "float" as a real request. Treat it as not being a specific type, don't let it override the intended output type for --autocc. (But a color space still marked as a particular integer bit depth is still an --autocc inferred request.) Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent 90f308b commit ddba92f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/oiiotool/oiiotool.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5905,10 +5905,11 @@ output_file(Oiiotool& ot, cspan<const char*> argv)
59055905
TypeDesc type;
59065906
int bits;
59075907
type = ot.colorconfig().getColorSpaceDataType(outcolorspace, &bits);
5908-
if (type.basetype != TypeDesc::UNKNOWN) {
5908+
if (type != TypeUnknown && type != TypeFloat) {
59095909
if (ot.debug)
5910-
std::cout << " Deduced data type " << type << " (" << bits
5911-
<< "bits) for output to " << filename << "\n";
5910+
OIIO::print(
5911+
" Deduced data type {} ({} bits) for output to {}\n", type,
5912+
bits, filename);
59125913
if ((ot.output_dataformat && ot.output_dataformat != type)
59135914
|| (bits && ot.output_bitspersample
59145915
&& ot.output_bitspersample != bits)) {

0 commit comments

Comments
 (0)