Improved scale action

Here is a patch for the scale action which adds a 'Scale down only' parameter.
--- /usr/local/src/phatch-0.1.bzr385/phatch/actions/scale.py 2008-02-21 09:32:48.000000000 +0100 +++ /home/fma/.phatch/actions/scale.py 2008-02-21 09:33:16.000000000 +0100 @@ -50,6 +50,7 @@ fields[_t('Resolution')] = self.DpiField('<%s>'%_t('dpi')) fields[_t('Constrain Proportions')] = self.BooleanField(True) fields[_t('Resample Image')] = self.ImageResampleField('bicubic') + fields[_t('Scale down only')] = self.BooleanField(True) def apply_pil(self,image): return image @@ -64,8 +65,9 @@ x0, y0 = info[new('Pil.Size')] x1 = self.get_field_size('Width',info,x0,dpi) y1 = self.get_field_size('Height',info,y0,dpi) - #check if image size has changed - if x0!=x1 or y0!=y1: + scaleDownOnly = self.get_field('Scale down only',info) + # check if image size has changed + if (x0!=x1 or y0!=y1) and (not scaleDownOnly or (scaleDownOnly and (x1<x0 or y1<y0))): proportions = self.get_field('Constrain Proportions',info) method = self.get_field('Resample Image',info) method = getattr(Image,method)