Add crop document page transformation.

This commit is contained in:
Roberto Rosario
2015-08-12 17:23:36 -04:00
parent 6a4562015e
commit 5bb8f779b3

View File

@@ -307,6 +307,20 @@ class TransformationZoom(BaseTransformation):
)
class TransformationCrop(BaseTransformation):
name = 'crop'
arguments = ('left', 'top', 'right', 'bottom',)
label = _('Crop')
def execute_on(self, *args, **kwargs):
super(TransformationCrop, self).execute_on(*args, **kwargs)
return self.image.crop(
(self.left, self.top, self.right, self.bottom)
)
BaseTransformation.register(TransformationResize)
BaseTransformation.register(TransformationRotate)
BaseTransformation.register(TransformationZoom)
BaseTransformation.register(TransformationCrop)