Commit 3aaec205 authored by Nicolas Delaby's avatar Nicolas Delaby

parameter handling of Image conversion changed, so follow new implemenation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35271 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1b1974e2
......@@ -1563,6 +1563,14 @@ style=3D'color:black'>05D65812<o:p></o:p></span></p>
transaction.commit()
self.tic()
preference_tool = getToolByName(self.portal, 'portal_preferences')
image_size = preference_tool.getPreferredThumbnailImageHeight(),\
preference_tool.getPreferredThumbnailImageWidth()
convert_kw = {'format': 'png',
'quality': 75,
'display': 'thumbnail',
'resolution': None}
class ThreadWrappedConverter(Thread):
"""Use this class to run different convertion
inside distinct Thread.
......@@ -1578,13 +1586,15 @@ style=3D'color:black'>05D65812<o:p></o:p></span></p>
def run(self):
for frame in self.frame_list:
# Use publish method to dispatch conversion among
# all available Zserver threads.
response = self.publish_method('%s/index_html?format=png'\
'&display=thumbnail&quality:int=75&resolution='\
'&frame=%s' % (self.document_path, frame),
self.credential)
assert response.getHeader('content-type') == 'image/png'
assert response.getStatus() == httplib.OK
# all available ZServer threads.
convert_kw['frame'] = frame
response = self.publish_method(self.document_path,
basic=self.credential,
extra=convert_kw)
assert response.getHeader('content-type') == 'image/png', \
response.getHeader('content-type')
assert response.getStatus() == httplib.OK
transaction.commit()
# assume there is no password
......@@ -1607,18 +1617,15 @@ style=3D'color:black'>05D65812<o:p></o:p></span></p>
transaction.commit()
self.tic()
preference_tool = getToolByName(self.portal, 'portal_preferences')
image_size = preference_tool.getPreferredThumbnailImageHeight(),\
preference_tool.getPreferredThumbnailImageWidth()
convert_kw = {'format': 'png',
'display': 'thumbnail',
'quality': 75,
'image_size': image_size,
'resolution': ''}
'resolution': None}
result_list = []
for i in xrange(pages_number):
# all conversions should succeeded and stored in cache storage
convert_kw['frame'] = str(i)
convert_kw['frame'] = i
if not document.hasConversion(**convert_kw):
result_list.append(i)
self.assertEquals(result_list, [])
......
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