From 653ceb517fe756b042a3cf8322a36cbfe71ddbd8 Mon Sep 17 00:00:00 2001 From: Koji Otani Date: Wed, 17 Nov 2010 00:07:03 +1030 Subject: [PATCH] PS: fix embedding of grayscale jpegs https://bugs.freedesktop.org/show_bug.cgi?id=31632 --- src/cairo-ps-surface.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index 71d83988b..0be68bf22 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -2377,11 +2377,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,