Gentoo Archives: gentoo-commits

From: "Marien Zwart (marienz)" <marienz@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-text/pdfshuffler/files: pdfshuffler-poppler-0.18.patch
Date: Wed, 29 Feb 2012 23:54:34
Message-Id: 20120229235421.46C322004C@flycatcher.gentoo.org
1 marienz 12/02/29 23:54:21
2
3 Added: pdfshuffler-poppler-0.18.patch
4 Log:
5 Add a patch to work with poppler >= 0.18, based on a patch by Rafał Mużyło in bug #390607.
6
7 (Portage version: 2.2.0_alpha89/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-text/pdfshuffler/files/pdfshuffler-poppler-0.18.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/pdfshuffler/files/pdfshuffler-poppler-0.18.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/pdfshuffler/files/pdfshuffler-poppler-0.18.patch?rev=1.1&content-type=text/plain
14
15 Index: pdfshuffler-poppler-0.18.patch
16 ===================================================================
17 Stop using render_to_pixbuf, removed from Poppler 0.18.
18
19 Instead draw to a gdk Pixmap, then get a Pixbuf from that.
20
21 A more complete fix (dropping Pixmap/Pixbuf usage) is in upstream svn,
22 but that is too large a change for us to take.
23
24 Based on a patch from Rafał Mużyło in gentoo bug #390607.
25 --- pdfshuffler
26 +++ pdfshuffler
27 @@ -982,9 +982,15 @@
28 pix_w, pix_h = page.get_size()
29 pix_w = int(pix_w * self.scale)
30 pix_h = int(pix_h * self.scale)
31 - thumbnail = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False,
32 - 8, pix_w , pix_h)
33 - page.render_to_pixbuf(0,0,pix_w,pix_h,self.scale,0,thumbnail)
34 + pixmap = gtk.gdk.Pixmap(None, pix_w, pix_h, 24)
35 + cr = pixmap.cairo_create()
36 + # The pixmap data is not initialized, so paint it white first:
37 + cr.set_source_rgb(1, 1, 1)
38 + cr.paint()
39 + cr.scale(self.scale, self.scale)
40 + page.render(cr)
41 + thumbnail = gtk.gdk.pixbuf_get_from_drawable(
42 + None, pixmap, gtk.gdk.colormap_get_system(), 0, 0, 0, 0, pix_w, pix_h)
43 rotation = (-rotation) % 360
44 rotation = ((rotation + 45) / 90) * 90
45 thumbnail = thumbnail.rotate_simple(rotation)
46 @@ -1003,11 +1009,13 @@
47 pix_w = thumbnail.get_width()
48 pix_h = thumbnail.get_height()
49 except:
50 + import traceback
51 + traceback.print_exc()
52 pix_w = self.default_width
53 pix_h = pix_w
54 thumbnail = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False,
55 8, pix_w, pix_h)
56 - pixbuf.fill(0xffffffff)
57 + thumbnail.fill(0xffffffff)
58
59 #add border
60 thickness = 3