From 0f6ec143612b29306e20b0512a8b1ea3b2cb7662 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Mon, 07 Feb 2011 14:05:17 +0000 Subject: trying base64 for draw_pixbuf sharing --- (limited to 'TurtleArt/tacollaboration.py') diff --git a/TurtleArt/tacollaboration.py b/TurtleArt/tacollaboration.py index 0bebe67..83ce835 100644 --- a/TurtleArt/tacollaboration.py +++ b/TurtleArt/tacollaboration.py @@ -225,13 +225,18 @@ class Collaboration(): def _draw_pixbuf(self, payload): if len(payload) > 0: - [nick, [a, b, x, y, w, h, width, height, stride, - bits_per_sample, has_alpha, colorspace, data]] =\ - data_from_string(payload) + [nick, [a, b, x, y, w, h, width, height, data]] =\ + data_from_string(payload) if nick != self._tw.nick: - self._tw.canvas.draw_pixbuf(gtk.gdk.pixbuf_new_from_data( - data, colorspace, has_alpha, bits_per_sample, width, - height, stride), a, b, x, y, w, h, None, False) + if self.tw.running_sugar: + tmp_path = get_path(self.tw.activity, 'instance') + else: + tmp_path = '/tmp' + file_name = base64_to_image(data, tmp_path) + pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(file_name, + width, height) + self._tw.canvas.draw_pixbuf(pixbuf, a, b, x, y, w, h, + file_name, False) def _move_forward(self, payload): if len(payload) > 0: -- cgit v0.9.1