Skip to content

Instantly share code, notes, and snippets.

@remia
Created October 11, 2022 20:34
Show Gist options
  • Save remia/9038a229ffe2370c1802dcf411beacba to your computer and use it in GitHub Desktop.
Save remia/9038a229ffe2370c1802dcf411beacba to your computer and use it in GitHub Desktop.
diff --git a/src/bindings/python/PyConfigIOProxy.cpp b/src/bindings/python/PyConfigIOProxy.cpp
index 5d04161f..7e2f5538 100644
--- a/src/bindings/python/PyConfigIOProxy.cpp
+++ b/src/bindings/python/PyConfigIOProxy.cpp
@@ -52,6 +52,7 @@ struct PyConfigIOProxy : ConfigIOProxy
void bindPyConfigIOProxy(py::module & m)
{
py::bind_vector<std::vector<uint8_t>>(m, "vector_of_uint8_t");
+ py::implicitly_convertible<py::list, std::vector<uint8_t>>();
py::class_<ConfigIOProxy, std::shared_ptr<ConfigIOProxy>, PyConfigIOProxy>(m, "PyConfigIOProxy")
.def(py::init())
diff --git a/tests/python/ConfigTest.py b/tests/python/ConfigTest.py
index 57c09bdc..7dfa1eb1 100644
--- a/tests/python/ConfigTest.py
+++ b/tests/python/ConfigTest.py
@@ -1114,18 +1114,15 @@ colorspaces:
# This implementation is only to demonstrate the functionality.
# Simulate that the LUT are coming from some kind of in-memory location.
- buffer = OCIO.vector_of_uint8_t()
if filepath == os.path.join('my_unique_luts', 'my_unique_lut1.clf'):
- encoded_c1_lut = C1_LUT.encode('utf-8')
- data = bytearray(encoded_c1_lut)
- for c in data:
- buffer.append(c)
+ data = list(C1_LUT.encode('utf-8'))
elif filepath == os.path.join('my_unique_luts', 'my_unique_lut2.clf'):
- encoded_c2_lut = C2_LUT.encode('utf-8')
- data = bytearray(encoded_c2_lut)
+ buffer = OCIO.vector_of_uint8_t()
+ data = list(C2_LUT.encode('utf-8'))
for c in data:
buffer.append(c)
- return buffer
+ data = buffer
+ return data
def getFastLutFileHash(self, filepath):
# This implementation is only to demonstrate the functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment