Author: post
Date: 2010-03-14 20:10:47 +0100 (Sun, 14 Mar 2010)
New Revision: 3258

Modified:
   trunk/plugins/cache/cache.c
Log:
Don't allow to return cached 8 bit images that are not in the same colorspace 
as the requested cs.

Modified: trunk/plugins/cache/cache.c
===================================================================
--- trunk/plugins/cache/cache.c 2010-03-14 19:03:24 UTC (rev 3257)
+++ trunk/plugins/cache/cache.c 2010-03-14 19:10:47 UTC (rev 3258)
@@ -206,6 +206,7 @@
 
                if (!roi && rs_filter_response_get_roi(cache->cached_image))
                        flush(cache);
+
        }
 
        if (!rs_filter_response_has_image(cache->cached_image))
@@ -258,6 +259,16 @@
 
                if (!roi && rs_filter_response_get_roi(cache->cached_image))
                        flush(cache);
+
+               RSColorSpace *cached_space = NULL;
+               if (cache->cached_image)
+                       cached_space = 
rs_filter_param_get_object_with_type(RS_FILTER_PARAM(cache->cached_image), 
"colorspace", RS_TYPE_COLOR_SPACE);
+
+               RSColorSpace *requested_space = 
rs_filter_param_get_object_with_type(RS_FILTER_PARAM(request), "colorspace", 
RS_TYPE_COLOR_SPACE);
+
+               if (cached_space && requested_space)
+                       if (cached_space != requested_space)
+                               flush(cache);
        }
 
        if (!rs_filter_response_has_image8(cache->cached_image))


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to