Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

This time we really create images.

Also tests got updated

svn path=/plone.app.blob/branches/do3cc-issue34/; revision=33906
  • Loading branch information...
commit a8454c3c231a409dc29ef222af975b1a1fd5e582 1 parent 30a5853
Patrick Gerken authored
4 src/plone/app/blob/mixins.py
View
@@ -40,8 +40,8 @@ def createScales(self, instance, **kwargs):
sizes = self.getAvailableSizes(instance)
handler = IImageScaleHandler(self, None)
if handler is not None:
- for scale in sizes.values():
- handler.getScale(instance, scale)
+ for scale, (width, height) in sizes.items():
+ handler.createScale(instance, scale, width, height)
class ImageMixin(ATCTImageTransform):
""" mixin class for methods needed for image content """
6 src/plone/app/blob/tests/test_scaling.py
View
@@ -100,7 +100,11 @@ def testImageRecreation(self):
atct_tool = getToolByName(self.portal, 'portal_atct')
atct_tool.recreateImageScales()
sizes = image.getField('image').getAvailableSizes(image)
- self.failUnless('thumb' in sizes.keys())
+ self.assertEquals(len(sizes), self.counter)
+ traverse = folder.REQUEST.traverseName
+ thumb = traverse(image, 'image_thumb')
+ blob = getattr(image, blobScalesAttr)['image']['thumb']['blob']
+ self.failUnless(isinstance(blob, Blob), 'no blob?')
def testBlobCreation(self):
data = getData('image.gif')
Please sign in to comment.
Something went wrong with that request. Please try again.