From 41ce9923c66f9f5bfc7de159ad4c0a68e16095c2 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 17 Feb 2009 17:27:22 +0000 Subject: [PATCH] - Fix bitcmyk driver (bug #486644). --- ghostscript-bitcmyk.patch | 35 +++++++++++++++++++++++++++++++++++ ghostscript.spec | 9 ++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 ghostscript-bitcmyk.patch diff --git a/ghostscript-bitcmyk.patch b/ghostscript-bitcmyk.patch new file mode 100644 index 0000000..718f22b --- /dev/null +++ b/ghostscript-bitcmyk.patch @@ -0,0 +1,35 @@ +diff -up ghostscript-8.64/base/gdevbit.c.bitcmyk ghostscript-8.64/base/gdevbit.c +--- ghostscript-8.64/base/gdevbit.c.bitcmyk 2008-08-21 00:58:43.000000000 +0100 ++++ ghostscript-8.64/base/gdevbit.c 2009-02-17 16:27:38.000000000 +0000 +@@ -653,7 +653,7 @@ bit_put_params(gx_device * pdev, gs_para + pdev->color_info.depth == 32 ? cmyk_8bit_map_cmyk_color : + bit_map_cmyk_color); + } +- /* Reset the sparable and linear shift, masks, bits. */ ++ /* Reset the separable and linear shift, masks, bits. */ + set_linear_color_bits_mask_shift(pdev); + pdev->color_info.separable_and_linear = GX_CINFO_SEP_LIN; + ((gx_device_bit *)pdev)->FirstLine = FirstLine; +@@ -671,16 +671,18 @@ bit_print_page(gx_device_printer * pdev, + byte *in = gs_alloc_bytes(pdev->memory, line_size, "bit_print_page(in)"); + byte *data; + int nul = !strcmp(pdev->fname, "nul") || !strcmp(pdev->fname, "/dev/null"); +- int lnum = ((gx_device_bit *)pdev)->FirstLine; +- int bottom = ((gx_device_bit *)pdev)->LastLine; ++ int lnum = ((gx_device_bit *)pdev)->FirstLine >= pdev->height ? pdev->height - 1 : ++ ((gx_device_bit *)pdev)->FirstLine; ++ int bottom = ((gx_device_bit *)pdev)->LastLine >= pdev->height ? pdev->height - 1 : ++ ((gx_device_bit *)pdev)->LastLine; + int line_count = any_abs(bottom - lnum); + int i, step = lnum > bottom ? -1 : 1; + + if (in == 0) + return_error(gs_error_VMerror); + if ((lnum == 0) && (bottom == 0)) +- bottom = pdev->height - 1; +- for (i = 0; i < line_count; i++, lnum += step) { ++ line_count = pdev->height - 1; /* default when LastLine == 0, FirstLine == 0 */ ++ for (i = 0; i <= line_count; i++, lnum += step) { + gdev_prn_get_bits(pdev, lnum, in, &data); + if (!nul) + fwrite(data, 1, line_size, prn_stream); diff --git a/ghostscript.spec b/ghostscript.spec index f703d3a..0e40e6f 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer. Name: ghostscript Version: %{gs_ver} -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 URL: http://www.ghostscript.com/ @@ -21,6 +21,7 @@ Patch4: ghostscript-fPIC.patch Patch5: ghostscript-runlibfileifexists.patch Patch6: ghostscript-system-jasper.patch Patch7: ghostscript-pksmraw.patch +Patch8: ghostscript-bitcmyk.patch Requires: urw-fonts >= 1.1, ghostscript-fonts BuildRequires: libjpeg-devel, libXt-devel @@ -104,6 +105,9 @@ rm -rf libpng zlib jpeg jasper # Fix pksmraw output (bug #308211). Still needed in 8.63. %patch7 -p1 -b .pksmraw +# Fix bitcmyk driver (bug #486644). +%patch8 -p1 -b .bitcmyk + # Convert manual pages to UTF-8 from8859_1() { iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_" @@ -285,6 +289,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libgs.so %changelog +* Tue Feb 17 2009 Tim Waugh 8.64-3 +- Fix bitcmyk driver (bug #486644). + * Wed Feb 4 2009 Tim Waugh 8.64-2 - 8.64 (bug #483958). - Removed trade marks to avoid any potential confusion.