Commit cfebfa1b authored by Ivan Tyagov's avatar Ivan Tyagov

when converting to image from PDF we care for first page only this will make...

when converting to image from PDF we care for first page only this will make sure that only first page is used and not whole content of PDF file read & converted which is a performance issue.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37102 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f5ea8027
...@@ -90,6 +90,11 @@ class PDFDocument(Image): ...@@ -90,6 +90,11 @@ class PDFDocument(Image):
elif format is None: elif format is None:
return self.getContentType(), self.getData() return self.getContentType(), self.getData()
else: else:
if kw.get('frame', None) is None:
# when converting to image from PDF we care for first page only
# this will make sure that only first page is used and not whole content of
# PDF file read & converted which is a performance issue
kw['frame'] = 0
return Image._convert(self, format, **kw) return Image._convert(self, format, **kw)
security.declareProtected(Permissions.ModifyPortalContent, 'populateContent') security.declareProtected(Permissions.ModifyPortalContent, 'populateContent')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment