From 1c4dc1393f563a3d3f675058cda181f26147689f Mon Sep 17 00:00:00 2001 From: Nwuguru Sunday Date: Tue, 19 Jul 2016 23:00:32 +0100 Subject: [PATCH] [Feature #126384987] Remove unused code --- app/photos/api/image_edit.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/photos/api/image_edit.py b/app/photos/api/image_edit.py index c7a58e8..5e25b3f 100644 --- a/app/photos/api/image_edit.py +++ b/app/photos/api/image_edit.py @@ -118,15 +118,14 @@ def rotate(self, value): self.output = self.output.rotate(int(actual_value)) def colorize(self, black="#000", white="#fff"): + """ applies colors to black and white image """ self.black_and_white() self.output = ImageOps.colorize(self.output, black, white) def expand(self, border=10, fill="#ff0"): + """ Add border to image """ self.output = ImageOps.expand(self.output, border=border, fill=fill) - def crop(self, box): - self.output = self.output.crop(box) - def vertical_flip(self): """ Flip the image vertically (top to bottom). """ self.output = ImageOps.flip(self.output) @@ -136,6 +135,7 @@ def mirror(self): self.output = ImageOps.mirror(self.output) def set_font(self, font_size=100, font_name="Honey-I-spilt-Verdana.ttf"): + """ Sets the font to be used for text drawing """ fonts_path = os.path.join( os.path.dirname(os.path.dirname( os.path.dirname(__file__))), 'static/fonts') @@ -151,11 +151,13 @@ def text(self, text, x, y, fill=(255, 255, 255), font_size=100, font_name="Honey del draw def preview(self): + """ Returns a base64 converted image """ buffered = cStringIO.StringIO() self.output.save(buffered, format=self.image_format) return base64.b64encode(buffered.getvalue()) def save(self): + """ Saves modified image """ path = self.path.replace('main', 'edited') edit_path = os.path.join( os.path.dirname(os.path.dirname(