[cairo-commit] Branch '1.10' - src/cairo-ps-surface.c

Adrian Johnson ajohnson at kemper.freedesktop.org
Thu Dec 16 07:41:20 PST 2010


 src/cairo-ps-surface.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit a27e3bc6d08feeac8e4ee5315a0ad974efee0ee9
Author: Koji Otani <sho at bbr.jp>
Date:   Wed Nov 17 00:07:03 2010 +1030

    PS: fix embedding of grayscale jpegs
    
    https://bugs.freedesktop.org/show_bug.cgi?id=31632
    (cherry picked from commit 653ceb517fe756b042a3cf8322a36cbfe71ddbd8)

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 6c7ad62..4ae1aee 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -2376,11 +2376,12 @@ _cairo_ps_surface_emit_jpeg_image (cairo_ps_surface_t    *surface,
 				 "  /Width %d def\n"
 				 "  /Height %d def\n"
 				 "  /BitsPerComponent %d def\n"
-				 "  /Decode [ 0 1 0 1 0 1 ] def\n",
+				 "  /Decode [ %s ] def\n",
 				 info.num_components == 1 ? "DeviceGray" : "DeviceRGB",
 				 info.width,
 				 info.height,
-				 info.bits_per_component);
+				 info.bits_per_component,
+                                 info.num_components == 1 ? "0 1" : "0 1 0 1 0 1");
 
     if (surface->use_string_datasource) {
 	_cairo_output_stream_printf (surface->stream,


More information about the cairo-commit mailing list