From 4d42458e95cc1f6813b5d2c8a77625a4e6b2a18b Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Tue, 25 May 2010 15:52:07 +0000
Subject: [PATCH] revert r29404 because it is not in good place (Should be in
 Image or at portal_transforms level) and change DPI even if size of image is
 low.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35622 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/PDFDocument.py | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/product/ERP5/Document/PDFDocument.py b/product/ERP5/Document/PDFDocument.py
index 8ffad24b5f..025e692ade 100644
--- a/product/ERP5/Document/PDFDocument.py
+++ b/product/ERP5/Document/PDFDocument.py
@@ -126,24 +126,9 @@ class PDFDocument(Image):
       text = ''
       content_information = self.getContentInformation()
       page_count = int(content_information.get('Pages', 0))
-      try:
-        # if the dimension is too big, rasterized image can be too
-        # big. so we limit the maximum of rasterized image to 4096
-        # pixles.
-        # XXX since the dimention can be different on each page, it is
-        # better to call 'pdfinfo -f page_num -l page_num' to get the
-        # size of each page.
-        max_size = 4096
-        size = content_information.get('Page size',
-                                       '%s x %s pts' % (max_size, max_size))
-        width = int(size.split(' ')[0])
-        height = int(size.split(' ')[2])
-        resolution = 72.0 * max_size / max(width, height)
-      except (ValueError, ZeroDivisionError):
-        resolution = None
       for page_number in range(page_count):
         src_mimetype, png_data = self.convert(
-            'png', quality=100, resolution=resolution,
+            'png', quality=100, resolution=300,
             frame=page_number, display='identical')
         if not src_mimetype.endswith('png'):
           continue
-- 
2.30.9