27 buffer = cStringIO.StringIO() |
27 buffer = cStringIO.StringIO() |
28 image.save(buffer, format="PNG") |
28 image.save(buffer, format="PNG") |
29 img_str = base64.b64encode(buffer.getvalue()) |
29 img_str = base64.b64encode(buffer.getvalue()) |
30 print json.dumps({ |
30 print json.dumps({ |
31 "objects": calc.circles, |
31 "objects": calc.circles, |
|
32 "offset": (calc.width - (2 * calc.margin)) / 2, |
32 "scale3d": config.SCALE3D, |
33 "scale3d": config.SCALE3D, |
33 "image": img_str |
34 "image": img_str |
34 }) |
35 }) |
35 else: |
36 else: |
36 print "unknown Action %s" % args["action"].value |
37 print "unknown Action %s" % args["action"].value |