Bug#355770: xpdf-reader: overeager clipping from rounding problem

2006-03-07 Thread Sanjoy Mahajan
Package: xpdf-reader
Version: 3.01-7
Severity: normal

The pdf file included inline below does not view correctly.  It is a
rectangle (200x100, in units of PostScript points) filled with green
and with a 0.5-point red border.  The border should stick out 0.25
points beyond each edge of the rectangle and have rounded corners.
The left and bottom borders view fine, but the top and right borders
are invisible.  Acroread 7.0.1 views it fine.  However, gs-afpl
(v8.53) also has problems (but that'll be investigated further for a
separate bug report).

Rounding up the BBox and MediaBox dimensions to the next whole point
fixes the problem, so I suspect the absence of the top and right
borders is due to incorrect rounding in the clipping paths.  To be
exact, if I apply this unified diff (0 lines of context) to the pdf
file below, then all the borders view fine:

--- rect-1-unc.pdf  2006-03-07 13:08:18.0 -0500
+++ rect-1-unc-expanded.pdf 2006-03-07 13:28:52.0 -0500
@@ -10 +10 @@
-/BBox [0 0 200.4977 100.4988]
+/BBox [0 0 201 101]
@@ -51 +51 @@
-/MediaBox [0 0 200.4977 100.4988]
+/MediaBox [0 0 201 101]

The rect-1-unc.pdf file below comes from this metapost file (rect.mp):

  beginfig(1)
  path p;
  p := unitsquare scaled 100bp xscaled 2;
  draw p withcolor red;
  fill p withcolor green;
  endfig;
  end

The sequence of commands:

  mpost rect.mp   [gives rect.1, a metapost EPS file]
  mptopdf rect.1  [gives rect-1.pdf]
  pdftk rect-1.pdf output rect-1-unc.pdf uncompress  [gives rect-1-unc.pdf]

Here is the PDF file rect-1-unc.pdf (should I have attached it
instead?):

%PDF-1.4
%âãÏÓ
1 0 obj
<>
stream
1 0 0 1 0 100.4988 cm
 q 1 0 0 1 0.25 0.25 cm
1 0 0 1 0 -100.4988 cm
 1 0 0 rg 1 0 0 RG
 0.5 w
 [ ]0 d
 1 j
 10 M
 0 0 m
 66.66565 0 133.33435 0 200 0 c
 200 100 l
 133.33435 100 66.66565 100 0 100 c
 h
 S
 0 1 0 rg 0 1 0 RG
 0 0 m
 66.66565 0 133.33435 0 200 0 c
 200 100 l
 133.33435 100 66.66565 100 0 100 c
 h
 f
1 0 0 1 0 100.4988 cm
 Q

endstream
endobj
2 0 obj
<>
endobj
3 0 obj
<>
/ProcSet [/PDF]
>>
endobj
4 0 obj
<>
endobj
6 0 obj
<>
stream
q
1 0 0 1 0 0 cm
/Fm1 Do
Q

endstream
endobj
5 0 obj
<>
endobj
7 0 obj
<>
endobj
8 0 obj
<>
endobj
xref
0 9
00 65535 f 
15 0 n 
000518 0 n 
000554 0 n 
000615 0 n 
000821 0 n 
000745 0 n 
000877 0 n 
000925 0 n 
trailer
<>
startxref
1128
%%EOF


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-rc5
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages xpdf-reader depends on:
ii  gsfonts   8.14+v8.11+urw-0.2 Fonts for the Ghostscript interpre
ii  lesstif2  1:0.94.4-1.1   OSF/Motif 2.1 implementation relea
ii  libc6 2.3.5-13   GNU C Library: Shared libraries an
ii  libfreetype6  2.1.10-1   FreeType 2 font engine, shared lib
ii  libgcc1   1:4.0.2-9  GCC support library
ii  libice6   6.9.0.dfsg.1-4 Inter-Client Exchange library
ii  libpaper1 1.1.14-5   Library for handling paper charact
ii  libsm66.9.0.dfsg.1-4 X Window System Session Management
ii  libstdc++64.0.2-9The GNU Standard C++ Library v3
ii  libt1-5   5.1.0-2Type 1 font rasterizer library - r
ii  libx11-6  6.9.0.dfsg.1-4 X Window System protocol client li
ii  libxext6  6.9.0.dfsg.1-4 X Window System miscellaneous exte
ii  libxp66.9.0.dfsg.1-4 X Window System printing extension
ii  libxpm4   6.9.0.dfsg.1-4 X pixmap library
ii  libxt66.9.0.dfsg.1-4 X Toolkit Intrinsics
ii  xpdf-common   3.01-7 Portable Document Format (PDF) sui
ii  zlib1g1:1.2.3-9  compression library - runtime

xpdf-reader recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#355770: xpdf-reader: overeager clipping from rounding problem

2006-03-07 Thread Hamish Moffatt
On Tue, Mar 07, 2006 at 01:55:20PM -0500, Sanjoy Mahajan wrote:
> The pdf file included inline below does not view correctly.  It is a
[..]
> Here is the PDF file rect-1-unc.pdf (should I have attached it
> instead?):

Hi,

Thanks for your report. Could you please send me the PDF by attachment?
I saved the text, but Xpdf says it was damaged, possibly due to the one
line of binary:

> %PDF-1.4
> %âãÏÓ


Hamish
-- 
Hamish Moffatt VK3SB <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]