Index: /WAeUP_SRP/trunk/Students.py
===================================================================
--- /WAeUP_SRP/trunk/Students.py	(revision 1710)
+++ /WAeUP_SRP/trunk/Students.py	(revision 1711)
@@ -26,5 +26,5 @@
 
 import DateTime
-# import PIL.Image
+import PIL.Image
 from StringIO import StringIO
 
@@ -646,4 +646,5 @@
             picture ="%s/import/pictures/%s.jpg" % (i_home,jamb_reg_no)
             app.manage_setLocalRoles(sid, ['Owner',])
+            
             picture_id = da['jamb_reg_no'].replace('/','_')
             file = None
@@ -654,5 +655,12 @@
                     break
             if file is not None:
-                outfile = file.read()
+                img = PIL.Image.open(file)
+                img.thumbnail((150,200),
+                              resample=PIL.Image.ANTIALIAS)
+                # We now need a buffer to write to. It can't be the same
+                # as the inbuffer as the PNG writer will write over itself.
+                outfile = StringIO()
+                img.save(outfile, format=img.format)            
+                #outfile = file.read()
                 app_doc.manage_addFile('passport',
                                        file=outfile,
