From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1S2tLu-0008L9-Mp for garchives@archives.gentoo.org; Wed, 29 Feb 2012 23:54:34 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C1E09E0874; Wed, 29 Feb 2012 23:54:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 91CAAE0949 for ; Wed, 29 Feb 2012 23:54:24 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 786E31B402A for ; Wed, 29 Feb 2012 23:54:22 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2079) id 46C322004C; Wed, 29 Feb 2012 23:54:21 +0000 (UTC) From: "Marien Zwart (marienz)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, marienz@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in app-text/pdfshuffler/files: pdfshuffler-poppler-0.18.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: pdfshuffler-poppler-0.18.patch X-VCS-Directories: app-text/pdfshuffler/files X-VCS-Committer: marienz X-VCS-Committer-Name: Marien Zwart Content-Type: text/plain; charset=utf8 Message-Id: <20120229235421.46C322004C@flycatcher.gentoo.org> Date: Wed, 29 Feb 2012 23:54:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 00e5a7eb-fe53-4690-86f4-7e082d5141bc X-Archives-Hash: a43f5363b929c5fee1d9b530de2c9f10 marienz 12/02/29 23:54:21 Added: pdfshuffler-poppler-0.18.patch Log: Add a patch to work with poppler >=3D 0.18, based on a patch by Rafa=C5= =82 Mu=C5=BCy=C5=82o in bug #390607. =20 (Portage version: 2.2.0_alpha89/cvs/Linux x86_64) Revision Changes Path 1.1 app-text/pdfshuffler/files/pdfshuffler-poppler-0.18.= patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/pdfshuffl= er/files/pdfshuffler-poppler-0.18.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/pdfshuffl= er/files/pdfshuffler-poppler-0.18.patch?rev=3D1.1&content-type=3Dtext/pla= in Index: pdfshuffler-poppler-0.18.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Stop using render_to_pixbuf, removed from Poppler 0.18. Instead draw to a gdk Pixmap, then get a Pixbuf from that. A more complete fix (dropping Pixmap/Pixbuf usage) is in upstream svn, but that is too large a change for us to take. Based on a patch from Rafa=C5=82 Mu=C5=BCy=C5=82o in gentoo bug #390607. --- pdfshuffler +++ pdfshuffler @@ -982,9 +982,15 @@ pix_w, pix_h =3D page.get_size() pix_w =3D int(pix_w * self.scale) pix_h =3D int(pix_h * self.scale) - thumbnail =3D gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, - 8, pix_w , pix_h) - page.render_to_pixbuf(0,0,pix_w,pix_h,self.scale,0,thumbnail= ) + pixmap =3D gtk.gdk.Pixmap(None, pix_w, pix_h, 24) + cr =3D pixmap.cairo_create() + # The pixmap data is not initialized, so paint it white firs= t: + cr.set_source_rgb(1, 1, 1) + cr.paint() + cr.scale(self.scale, self.scale) + page.render(cr) + thumbnail =3D gtk.gdk.pixbuf_get_from_drawable( + None, pixmap, gtk.gdk.colormap_get_system(), 0, 0, 0, 0,= pix_w, pix_h) rotation =3D (-rotation) % 360 rotation =3D ((rotation + 45) / 90) * 90 thumbnail =3D thumbnail.rotate_simple(rotation) @@ -1003,11 +1009,13 @@ pix_w =3D thumbnail.get_width() pix_h =3D thumbnail.get_height() except: + import traceback + traceback.print_exc() pix_w =3D self.default_width pix_h =3D pix_w thumbnail =3D gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, pix_w, pix_h) - pixbuf.fill(0xffffffff) + thumbnail.fill(0xffffffff) =20 #add border thickness =3D 3