Permalink
Browse files

Fuck me, right?

  • Loading branch information...
1 parent ed097ba commit 6baed92ed8df786a4acf242f88a13f0bfe1d5645 Ben Mays committed Aug 5, 2012
Showing with 17 additions and 21 deletions.
  1. +14 −18 app/lib/postcard.py
  2. +3 −3 app/templates/create_postcard.html
View
@@ -1,34 +1,30 @@
#!/usr/bin/env python
-#from PIL import Image, ImageDraw
-Import = ""
-ImageDraw = ""
+from PIL import Image, ImageDraw
+
class Postcard(object):
_card_width = 1838
_card_height = 1238
_image_padding = 8
def __init__(self):
- # self.images = []
- # self.canvas = Image.new('RGBA', (
- # self._card_width,
- # self._card_height))
- # self.canvas.paste((255, 255, 255),
- # (0, 0, self._card_width, self._card_height))
- return
+ self.images = []
+ self.canvas = Image.new('RGBA', (
+ self._card_width,
+ self._card_height))
+ self.canvas.paste((255, 255, 255),
+ (0, 0, self._card_width, self._card_height))
+
def add_image(self, path):
- return
- # self.images.append(Image.open(path))
+ self.images.append(Image.open(path))
def calculate_padding(self, x, y, grid_size):
- return;
- # unused_x = self._card_width - (grid_size[0] * x)
- # unused_y = self._card_height - (grid_size[1] * y)
+ unused_x = self._card_width - (grid_size[0] * x)
+ unused_y = self._card_height - (grid_size[1] * y)
- # return (unused_x / (grid_size[0] + 1),
- # unused_y / (grid_size[1] + 1))
+ return (unused_x / (grid_size[0] + 1),
+ unused_y / (grid_size[1] + 1))
def generate_grid(self, grid_size=(3,3)):
- return;
x = self.images[0].size[0]
y = 50000
@@ -134,13 +134,13 @@
<div class="left-layout">
<h3 style="padding:5px 0 0 0">Layout</h3>
<div class="layout-tile active" id="layout-1" data-dimensions="1">
- <img src="http://img1.etsystatic.com/000/0/6059640/il_75x75.318354433.jpg" width="120" height="80" alt="Handmade Jewelry. Daffodil Earrings, sterling silver and 4 genuine pearls.">
+ <img src="{{url_for('static', filename='img/1x1.png') }}" width="120" height="80">
</div>
<div class="layout-tile" id="layout-4" data-dimensions="2">
- <img src="http://img1.etsystatic.com/000/0/6059640/il_75x75.318354433.jpg" width="120" height="80" alt="Handmade Jewelry. Daffodil Earrings, sterling silver and 4 genuine pearls.">
+ <img src="{{url_for('static', filename='img/2x2.png') }}" width="120" height="80">
</div>
<div class="layout-tile" id="layout-9" data-dimensions="3">
- <img src="http://img1.etsystatic.com/000/0/6059640/il_75x75.318354433.jpg" width="120" height="80" alt="Handmade Jewelry. Daffodil Earrings, sterling silver and 4 genuine pearls.">
+ <img src="{{url_for('static', filename='img/3x3.png') }}" width="120" height="80">
</div>
</div>

0 comments on commit 6baed92

Please sign in to comment.