Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tautils.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2011-02-06 21:31:03 (GMT)
committer Walter Bender <walter@sugarlabs.org>2011-02-06 21:31:03 (GMT)
commit738a307f3b24ee9b2de16e7e56d495a14709eef8 (patch)
tree61d2206eb188faa3f83f551a2e7a4edadab92a77 /TurtleArt/tautils.py
parent903a46158ea8daa17ebf9968ec6fab071345d736 (diff)
image_to_base64 accepts pathname
Diffstat (limited to 'TurtleArt/tautils.py')
-rw-r--r--TurtleArt/tautils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py
index c66b322..414935a 100644
--- a/TurtleArt/tautils.py
+++ b/TurtleArt/tautils.py
@@ -285,12 +285,12 @@ def get_path(activity, subpath):
"org.laptop.TurtleArtActivity", subpath))
-def image_to_base64(pixbuf, activity):
+def image_to_base64(pixbuf, pathname):
""" Convert an image to base64 """
- _file_name = os.path.join(get_path(activity, 'instance'), 'imagetmp.png')
+ _file_name = os.path.join(pathname, 'imagetmp.png')
if pixbuf != None:
pixbuf.save(_file_name, "png")
- _base64 = os.path.join(get_path(activity, 'instance'), 'base64tmp')
+ _base64 = os.path.join(pathname, 'base64tmp')
_cmd = "base64 <" + _file_name + " >" + _base64
subprocess.check_call(_cmd, shell=True)
_file_handle = open(_base64, 'r')