Bug#507877: keyjnote: traceback appears loading pdf

2008-12-05 Thread Junichi Uekawa
Package: keyjnote
Version: 0.10.2-1
Severity: normal


when loading 
http://tokyodebian.alioth.debian.org/pdf/debianmeetingresume200809-presentation.pdf
http://tokyodebian.alioth.debian.org/pdf/debianmeetingresume200809.pdf
http://tokyodebian.alioth.debian.org/pdf/debianmeetingresume2008011-presentation.pdf
http://tokyodebian.alioth.debian.org/pdf/debianmeetingresume2008011.pdf

I seem to get the following backtrace; keyjnote does display and work,
but there's a dead thread.


Welcome to KeyJnote version 0.10.2
there is no soundcard
Detected screen size: 1280x800 pixels
OpenGL renderer: Mesa DRI Intel(R) 965GM 4.1.3002
Using GL_ARB_texture_non_power_of_two.
Unhandled exception in thread started by function RenderThread at 0x1abcc80
Traceback (most recent call last):
  File /usr/bin/keyjnote, line 1822, in RenderThread
ParsePDF(pdf)
  File /usr/bin/keyjnote, line 1378, in ParsePDF
pdf = PDFParser(TempFileName + .pdf)
  File /usr/bin/keyjnote, line 1159, in __init__
self.scan_page_tree(root['Pages'].ref)
  File /usr/bin/keyjnote, line 1288, in scan_page_tree
self.scan_page_tree(kid.ref, node.get('MediaBox', mbox), 
node.get('CropBox', cbox))
  File /usr/bin/keyjnote, line 1288, in scan_page_tree
self.scan_page_tree(kid.ref, node.get('MediaBox', mbox), 
node.get('CropBox', cbox))
  File /usr/bin/keyjnote, line 1288, in scan_page_tree
self.scan_page_tree(kid.ref, node.get('MediaBox', mbox), 
node.get('CropBox', cbox))
  File /usr/bin/keyjnote, line 1294, in scan_page_tree
self.annots[page] = [a.ref for a in node.get('Annots', [])]
TypeError: iteration over non-sequence
Total presentation time: 0:01.


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=ja_JP.eucJP, LC_CTYPE=ja_JP.eucJP (charmap=EUC-JP) (ignored: 
LC_ALL set to ja_JP.eucJP)
Shell: /bin/sh linked to /bin/bash

Versions of packages keyjnote depends on:
ii  perl5.10.0-17Larry Wall's Practical Extraction 
ii  poppler-utils   0.8.7-1  PDF utilitites (based on libpopple
ii  python  2.5.2-3  An interactive high-level object-o
ii  python-imaging  1.1.6-3  Python Imaging Library
ii  python-opengl   3.0.0~b6-2   Python bindings to OpenGL
ii  python-pygame   1.7.1release-4.2 SDL bindings for games development
ii  python-support  0.8.4automated rebuilding support for P
ii  xpdf-reader 3.02-1.4 Portable Document Format (PDF) sui

Versions of packages keyjnote recommends:
ii  ghostscript-x [gs]   8.62.dfsg.1-3.1 The GPL Ghostscript PostScript/PDF
ii  gs   8.62.dfsg.1-3.1 Transitional package
ii  pdftk1.41-3  useful tool for manipulating PDF d

Versions of packages keyjnote suggests:
ii  latex-beamer  3.07-1 LaTeX class to produce presentatio

-- no debconf information



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



Bug#507877: keyjnote: traceback appears loading pdf

2008-12-05 Thread Martin Fiedler
 Can reproduce it with first example url: at that point 
 
 node.get('Annots', [])
 
 returns
 
 PDFref(50)

Thanks for pointing it out. I fixed the parser so that it understands
files with this, well, interesting document structure :) However, the
document in question seems to be problematic anyway -- Xpdf doesn't
display everything (OK, that might be because I'm missing some Asian fonts
here) and GhostScript even crashes completely :(

The patch will be included in the next upstream version, but if the
package maintainer is interested in fixing this with a new package
revision, there's also a patch against 0.10.2.

Martin J. Fiedler--- _releases/Impressive-0.10.2/impressive.py	2008-09-18 22:53:10.0 +0200
+++ impressive.py	2008-12-05 18:51:03.0 +0100
@@ -1247,10 +1247,13 @@
 if not offset:
 raise PDFError, referenced non-existing PDF object
 self.f.seek(offset)
-header = self.getline().split(None, 2)
-if (header[-1] != obj) or (header[0] != str(obj)):
+header = self.getline().split(None, 3)
+if (len(header)  3) or (header[2] != obj) or (header[0] != str(obj)):
 raise PDFError, object does not start where it's supposed to
-data = []
+if len(header) == 4:
+data = [header[3]]
+else:
+data = []
 while True:
 line = self.getline()
 if line in (endobj, stream): break
@@ -1310,10 +1313,13 @@
 self.scan_page_tree(kid.ref, node.get('MediaBox', mbox), node.get('CropBox', cbox))
 else:
 page = self.page_count + 1
+anode = node.get('Annots', [])
+if anode.__class__ == PDFref:
+anode = self.getobj(anode.ref)
 self.page_count = page
 self.obj2page[obj] = page
 self.page2obj[page] = obj
-self.annots[page] = [a.ref for a in node.get('Annots', [])]
+self.annots[page] = [a.ref for a in anode]
 self.box[page] = node.get('CropBox', cbox) or node.get('MediaBox', mbox)
 
 def dest2page(self, dest):


Bug#507877: keyjnote: traceback appears loading pdf

2008-12-05 Thread Yaroslav Halchenko
Thank you Martin...

As soon as current impressive (0.10.1) passes through NEW, I would
update it with given patch

Cheers

On Fri, 05 Dec 2008, Martin Fiedler wrote:

 The patch will be included in the next upstream version, but if the
 package maintainer is interested in fixing this with a new package
 revision, there's also a patch against 0.10.2.

 Martin J. Fiedler


-- 
Yaroslav Halchenko
Research Assistant, Psychology Department, Rutgers-Newark
Student  Ph.D. @ CS Dept. NJIT
Office: (973) 353-1412 | FWD: 82823 | Fax: (973) 353-1171
101 Warren Str, Smith Hall, Rm 4-105, Newark NJ 07102
WWW: http://www.linkedin.com/in/yarik



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