Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-03-20 12:57:20 (GMT)
committer Daniel Drake <dsd@laptop.org>2013-03-25 20:57:37 (GMT)
commit9bceeec1a24bb3b7c579e432f1a0f1d4d9caf721 (patch)
treef65bb1839b40118680f7145fc46756f4d7c3c27f /utils.py
parent07f557ded08cc24dafd15bd596355308206a2680 (diff)
Don't save preview encoded - SL #4470
We don't need save the preview in the metadata encoded, doing it makes more difficult the interoperability with other activities using it, and takes more space in the disk. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index 28adc9c..701e45f 100644
--- a/utils.py
+++ b/utils.py
@@ -8,12 +8,19 @@ from time import strftime
import constants
-def getStringFromPixbuf(pixbuf):
+
+def getStringEncodedFromPixbuf(pixbuf):
data = [""]
pixbuf.save_to_callback(_saveDataToBufferCb, "png", {}, data)
return base64.b64encode(str(data[0]))
+def getStringFromPixbuf(pixbuf):
+ data = [""]
+ pixbuf.save_to_callback(_saveDataToBufferCb, "png", {}, data)
+ return str(data[0])
+
+
def _saveDataToBufferCb(buf, data):
data[0] += buf
return True