Skip to content

Commit 0837939

Browse files
committed
ImageSpec: allow getattribute("format") to retrieve the data type name
1 parent 4ce5194 commit 0837939

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libOpenImageIO/formatspec.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,11 @@ ImageSpec::find_attribute(string_view name, ParamValue& tmpparam,
427427
GETINT(tile_depth);
428428
GETINT(alpha_channel);
429429
GETINT(z_channel);
430+
if (MATCH("format", TypeString)) {
431+
const char* formatstr = this->format.c_str();
432+
tmpparam.init("format", TypeString, 1, &formatstr);
433+
return &tmpparam;
434+
}
430435

431436
// some special cases -- assemblies of multiple fields or attributes
432437
if (MATCH("geom", TypeString)) {

0 commit comments

Comments
 (0)