[poppler] utils/pdftoppm.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Fri Dec 18 12:24:40 PST 2009


 utils/pdftoppm.cc |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit df0ccddb7f784b4a8564beda51b3047cb9e3611a
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Dec 18 20:23:48 2009 +0000

    move the retrieval of the bitmap after rendering the page as it can change on render time

diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index e27aa44..2c4e869 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -18,6 +18,7 @@
 // Copyright (C) 2009 Michael K. Johnson <a1237 at danlj.org>
 // Copyright (C) 2009 Shen Liang <shenzhuxi at gmail.com>
 // Copyright (C) 2009 Stefan Thomas <thomas at eload24.com>
+// Copyright (C) 2009 Albert Astals Cid <aacid at kde.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -146,8 +147,6 @@ static void savePageSlice(PDFDoc *doc,
                    int pg, int x, int y, int w, int h, 
                    double pg_w, double pg_h, 
                    char *ppmFile) {
-  SplashBitmap *bitmap = splashOut->getBitmap();
-  
   if (w == 0) w = (int)ceil(pg_w);
   if (h == 0) h = (int)ceil(pg_h);
   w = (x+w > pg_w ? (int)ceil(pg_w-x) : w);
@@ -158,6 +157,9 @@ static void savePageSlice(PDFDoc *doc,
     !useCropBox, gFalse, gFalse,
     x, y, w, h
   );
+
+  SplashBitmap *bitmap = splashOut->getBitmap();
+  
   if (ppmFile != NULL) {
     if (png) {
       bitmap->writeImgFile(splashFormatPng, ppmFile);


More information about the poppler mailing list