OpenColorIO
OpenColorIO copied to clipboard
OpenColorIO in Android is not able to read configuration files
:wave:
This is to report that OpenColorIO is not able to read complete configuration files on Android due to its reliance on POSIX API semantics. Recent Android versions have introduced a "Scoped Storage" feature 1 to sandbox filesystem access by applications, and this unfortunately covers native code like OCIO's; the practical effect is that the system sends the app a "content://..." URL that is not parsable by native APIs.
This means that the only way to have a fully-functional, color-managed app is to supply a fully self-contained configuration file via OCIO::Config::CreateFromStream, as normal usage will fail at either the configuration creation or the LUT reading step.
the practical effect is that the system sends the app a "content://..." URL that is not parsable by native APIs.
If we focus on reading a config file and later, creating/using some color transformations (i.e. no modification of the config file), is there something to do to improve OpenColorIO when accessing a LUT file ?
I'm really not sure, because the main concern is that Android's sandboxing doesn't let the library figure out a relative path given a content:// URL. (Nor can it load these URLs, or read a configuration from an opened file descriptor.)
If OCIO had a container format (e.g. ZIP packaging config.ocio along with any other needed file), it would be way easier to work around this.
If OCIO had a container format (e.g. ZIP packaging config.ocio along with any other needed file), it would be way easier to work around this.
Agreed, indeed I think this would be useful in a number of situations beyond Android.
@doug-walker @hodoulp this was fixed by #1696, I hope to persuade the team to give it an acid test on our Android builds.