  void qcms_profile_precache_output_transform(qcms_profile *profile);
  
  qcms_transform* qcms_transform_create(
-@@ -146,6 +161,7 @@ qcms_transform* qcms_transform_create(
- void qcms_transform_release(qcms_transform *);
+@@ -143,9 +158,14 @@ qcms_transform* qcms_transform_create(
+ 		qcms_profile* out, qcms_data_type out_type,
+ 		qcms_intent intent);
+ 
+-void qcms_transform_release(qcms_transform *);
++qcms_bool qcms_transform_create_LUT_zyx_bgra(
++		qcms_profile *in, qcms_profile* out, qcms_intent intent,
++		int samples, unsigned char* lut);
  
  void qcms_transform_data(qcms_transform *transform, void *src, void *dest, size_t length);
 +void qcms_transform_data_type(qcms_transform *transform, void *src, void *dest, size_t length, qcms_output_type type);
++
++void qcms_transform_release(qcms_transform *);
  
  void qcms_enable_iccv4();
  

+    dest[b_out] = otdata_b[output[2]];
 }
diff --git a/third_party/qcms/src/transform.c b/third_party/qcms/src/transform.c
index 9a6562b..08db142 100644
--- a/third_party/qcms/src/transform.c
+++ b/third_party/qcms/src/transform.c
@@ -181,11 +181,20 @@ compute_chromatic_adaption(struct CIE_XYZ source_white_point,

 	length = read_u32(src, 0);
 	if (length <= size) {
 		// shrink the area that we can read if appropriate
@@ -1028,6 +1194,15 @@ qcms_profile* qcms_profile_from_memory(const void *mem, size_t size)
 	if (!src->valid || !index.tags)
 		goto invalid_tag_table;
 
+	if (!read_tag_descType(profile, src, index, TAG_desc))
+		goto invalid_tag_table;
+#if defined(__APPLE__)
+	if (!read_tag_dscmType(profile, src, index, TAG_dscm))
+		goto invalid_tag_table;
+	if (!read_tag_mmodType(profile, src, index, TAG_mmod))
+		goto invalid_tag_table;
+#endif // __APPLE__
+
 	if (find_tag(index, TAG_CHAD)) {
 		profile->chromaticAdaption = read_tag_s15Fixed16ArrayType(src, index, TAG_CHAD);
 	} else {
@@ -1098,6 +1273,16 @@ invalid_profile:
 	return INVALID_PROFILE;
 }
 
