[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#192639: marked as done (gs: ImageType3 renders incorrectly in certain cases)



Your message dated Wed, 18 Oct 2006 21:56:16 +0900
with message-id <20061018125618.8AFA6722838@marx.e.u-tokyo.ac.jp>
and subject line (no subject)
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: gs
Version: 7.06-1.1
Severity: normal


The following postscript renders incorrectly in every version of
ghostscript I have tried it on, 7.04 (aladdin), 7.05.06 (ESP) and 7.06
(gnu):  It leaves a blank line on line 258 of the output, due to the
mask data and image daa being out of sync (and scaled differently)

%!PS-Adobe-3.0
%
% This program demonstrates a bug in Ghoscript's Masked Image rendering.
% To reproduce the bug, use the following command-line:
%
%   gs -r371 -g100x800 gsbug.ps
%
% You should notice a one-pixel horizontal white line near the top of
% the picture.  To save the bad result to a file, use the following
% command-line:
%
%   gs -q -r371 -g100x800 -sDEVICE=ppmraw -dBATCH -dNOPAUSE -sOutputFile=gsbug.ppm gsbug.ps
%

/ImageDataDictionary <<
  /ImageType 1
  /Width 1
  /Height 1000
  /BitsPerComponent 8
  /DataSource <ff108080>
  /MultipleDataSources false
  /ImageMatrix [ 1 0 0 -1483 0 1000 ]
  /Decode [ 0 1 0 1 0 1 ]
>> def

/ImageMaskDictionary <<
  /ImageType 1
  /Width 1
  /Height 1000
  /BitsPerComponent 8
  /MultipleDataSources false
  /ImageMatrix [ 1 0 0 -1483 0 1000 ]
  /Decode [ 1 0 ]
>> def

/MaskedImageDictionary <<
  /ImageType 3
  /InterleaveType 1
  /MaskDict ImageMaskDictionary
  /DataDict ImageDataDictionary
>> def

[100 0 0 -1484.00012 0 1000] setmatrix
/DeviceRGB setcolorspace
MaskedImageDictionary image

showpage

The following patch (made by Jeong Kim from ghostscript.com) fixes
the problem:

Log:
When scaling factors of /ImageMatrix in a image mask for ImageType3 are
negative, translation offset values for image mask rendering are
incorrect and it makes abnormal output (eg. white lines).
This patch fixes this bug #686843. Thanks to Len Sorensen for the analysis.

diff -C2 -r1.11 gximage3.c
*** src/gximage3.c      25 Oct 2002 00:27:10 -0000      1.11
--- src/gximage3.c      9 May 2003 05:47:30 -0000
***************
*** 328,334 ****
        (code = gs_bbox_transform(&mrect, &mat, &mrect)) < 0
        )
!       return code;
!     origin.x = (int)floor(mrect.p.x);
!     origin.y = (int)floor(mrect.p.y);
      code = make_mid(&mdev, dev, (int)ceil(mrect.q.x) - origin.x,
                    (int)ceil(mrect.q.y) - origin.y, mem);
--- 328,336 ----
        (code = gs_bbox_transform(&mrect, &mat, &mrect)) < 0
        )
!       return code;
!
!     origin.x = (mrect.p.x < 0) ? (int)ceil(mrect.p.x) : (int)floor(mrect.p.x);
!     origin.y = (mrect.p.y < 0) ? (int)ceil(mrect.p.y) : (int)floor(mrect.p.y);
!
      code = make_mid(&mdev, dev, (int)ceil(mrect.q.x) - origin.x,
                    (int)ceil(mrect.q.y) - origin.y, mem);

The line numbers may be slightly off, but the some code change is needed
in all ghostscript versions to fix the issue.

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux arrow 2.4.20-p2-smp-og #1 SMP Tue Dec 17 10:35:41 EST 2002 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages gs depends on:
ii  gs-common                     0.3.3.1    Common files for different Ghostsc
ii  libc6                         2.3.1-17   GNU C Library: Shared libraries an
ii  libgimpprint1                 4.2.5-3    Gimp-Print printer drivers - core 
ii  libpaper1                     1.1.13     Library for handling paper charact
ii  libpng12-0                    1.2.5.0-2  PNG library - runtime
ii  xlibs                         4.2.1-6    X Window System client libraries
ii  zlib1g                        1:1.1.4-11 compression library - runtime

-- debconf information:
* gs/previewer: true
* gs/substitute: true
* gs/printer: true



--- End Message ---
--- Begin Message ---
Had been fixed in the upstream.

--
Masayuki Hatta
Graduate School of Economics, The University of Tokyo

--- End Message ---

Reply to: