OpenColorIO icon indicating copy to clipboard operation
OpenColorIO copied to clipboard

OpenColorIO in Android is not able to read configuration files

Open amyspark opened this issue 3 years ago • 3 comments

: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.

amyspark avatar Jan 05 '22 23:01 amyspark

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 ?

hodoulp avatar Jan 07 '22 14:01 hodoulp

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.

amyspark avatar Jan 10 '22 15:01 amyspark

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 avatar Jan 10 '22 20:01 doug-walker

@doug-walker @hodoulp this was fixed by #1696, I hope to persuade the team to give it an acid test on our Android builds.

amyspark avatar Oct 27 '22 16:10 amyspark