Skip to content

Conversation

@dendenxu
Copy link

This PR adds the part_indices api to the write function of the OpenEXR Python wrapper, similar to #2149
However, different from the read API, we cannot create a new file every time a new part needs to be written on disk, which would result in the previously written data being overwritten. Thus, I added a persistent pointer to a MultiPartOutputFile, just like what we would do if using the C++ API. Another problem arises where the already written part would be cached in a map in the MultiPartOutputFile, leading to growing memory usage even though that part has already been written to the disk and that memory is not needed anymore, so I added another API for deleting this cache file in the MultiPartOutputFile object's map.

The current structure and API design might not be optimal, and I've only tested the regular case where a non-deep scanline multi-part image sequence is written to disk streamingly, where the generation of new part data and the operation of writing them to the disk is happening at the same time.

This commit fixes the issue where an unfinished multi-part file could
not be loaded properly in the python warpper for OpenEXR. This happens
when headers for the multi-part file are written to disk but the actual
pixels never finish being written.

The current fix skips the corrupted or empty parts with no pixel data
while retaining the ability for loading the correct ones.

Signed-off-by: dendenxu <zhenx@zju.edu.cn>
This can specify the specific parts of a multi-part EXR file to be
loaded to avoid excessive IO when only some parts of the file is needed
by the program.

This functionality could be particular useful when the file is very
large and only a very small portion of it is required in memory.

Signed-off-by: dendenxu <zhenx@zju.edu.cn>
Signed-off-by: dendenxu <zhenx@zju.edu.cn>
Signed-off-by: dendenxu <zhenx@zju.edu.cn>
Signed-off-by: dendenxu <zhenx@zju.edu.cn>
Signed-off-by: dendenxu <zhenx@zju.edu.cn>
Signed-off-by: dendenxu <zhenx@zju.edu.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant