Skip to content

Commit

Permalink
[Feature #126384987] Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Nwuguru Sunday committed Jul 19, 2016
1 parent 37f9b19 commit 1c4dc13
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/photos/api/image_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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')
Expand All @@ -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(
Expand Down

0 comments on commit 1c4dc13

Please sign in to comment.