OpenImageIO icon indicating copy to clipboard operation
OpenImageIO copied to clipboard

[FEATURE REQUEST] Optimize ImageInput::read_tiles for multi-part EXR

Open MrKepzie opened this issue 3 years ago • 0 comments

In the case of EXR tiled multi-part files, ImageInput::read_tiles will almost never fall in the case

 if (native_data && contiguous
        && (xend - xbegin) == nxtiles * spec.tile_width
        && (yend - ybegin) == nytiles * spec.tile_height
        && (zend - zbegin) == nztiles * spec.tile_depth) 

because it only works if the image has size multiple of tile size.

Then the code goes into ImageInput::read_tile which forgets completly about the requested number of channels and ends up decoding all the channels, just to return at the end the channels that were requested. For high resolution EXR files with a lot of channels, this makes openimageio compltely unviable when encoutering tiled EXRs.

Could this case be adapted to just decode the requested channels in the first place?

MrKepzie avatar May 16 '22 16:05 MrKepzie