summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoji Otani <sho@bbr.jp>2010-11-17 00:07:03 +1030
committerAdrian Johnson <ajohnson@redneon.com>2010-12-17 02:08:47 +1030
commita27e3bc6d08feeac8e4ee5315a0ad974efee0ee9 (patch)
tree229b6627569d910519c546c46b501f495ba00a7a
parent4aabff8f6740e2027febd97c1863f7ba5a46cb92 (diff)
downloadcairo-a27e3bc6d08feeac8e4ee5315a0ad974efee0ee9.tar.gz
PS: fix embedding of grayscale jpegs
https://bugs.freedesktop.org/show_bug.cgi?id=31632 (cherry picked from commit 653ceb517fe756b042a3cf8322a36cbfe71ddbd8)
-rw-r--r--src/cairo-ps-surface.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 6c7ad6229..4ae1aeede 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,