summaryrefslogtreecommitdiff
path: root/wpcreator/generator.py
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2010-07-12 05:52:08 -0400
committerGuillaume Seguin <guillaume@segu.in>2010-07-12 05:52:08 -0400
commitac5693369e44b5b95729f998b39f9f843204ae61 (patch)
tree186bfa3ebf5346515dffcdcfd84dbec49ac76772 /wpcreator/generator.py
downloadmultiwpcreator-ac5693369e44b5b95729f998b39f9f843204ae61.tar.gz
multiwpcreator-ac5693369e44b5b95729f998b39f9f843204ae61.tar.bz2
Initial import
Diffstat (limited to 'wpcreator/generator.py')
-rw-r--r--wpcreator/generator.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/wpcreator/generator.py b/wpcreator/generator.py
new file mode 100644
index 0000000..7f22c55
--- /dev/null
+++ b/wpcreator/generator.py
@@ -0,0 +1,21 @@
+import pygtk
+pygtk.require ("2.0")
+import gtk
+import cairo
+
+from PIL import Image
+
+def assemble (images):
+ full_width = 0
+ full_height = 0
+ for image in images:
+ width, height = image.size
+ full_width += width
+ full_height = max (height, full_height)
+ dest = Image.new ("RGB", (full_width, full_height))
+ x = 0
+ for image in images:
+ width, height = image.size
+ dest.paste (image, (x, 0))
+ x += width
+ return dest