diff options
author | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-09-04 22:38:06 (GMT) |
---|---|---|
committer | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-09-04 22:38:06 (GMT) |
commit | 2ca3591c006c6570116a3f19abd17571160fa4f7 (patch) | |
tree | b05eac563d8c7d42524ffda0227fc10468e5c69f /recorded.py | |
parent | 64315697c796197a5d914b2b34b6e251cc2a28ef (diff) |
dictionaries for mediaHash
git-svn-id: http://mediamods.com/public-svn/camera-activity/Record.activity@426 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'recorded.py')
-rw-r--r-- | recorded.py | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/recorded.py b/recorded.py index 3fc3422..45c3968 100644 --- a/recorded.py +++ b/recorded.py @@ -103,6 +103,7 @@ class Recorded: import base64 data = base64.b64decode(self.datastoreOb.metadata['preview']) pbl.write(data) + pbl.close() return pbl.get_pixbuf() @@ -125,6 +126,7 @@ class Recorded: import base64 data = base64.b64decode(self.datastoreOb.metadata['preview']) pbl.write(data) + pbl.close() #todo: write to tmp (rainbow?) and random unused filename... thumbFilepath = os.path.join(self.ca.journalPath, "thumb.png") @@ -136,13 +138,11 @@ class Recorded: def getAudioImagePixbuf( self ): + audioPixbuf = None if (self.datastoreId == None): - #just taken, so it is in the tempSessionDir - #so load file, convert to pixbuf, and return it here... - audioPixbuf = None - audioFilepath = os.path.join(self.ca.journalPath, self.audioImageFilename) - if ( os.path.isfile(audioFilepath) ): - return audioFilepath + audioFilepath = self.getAudioImageFilepath() + if (audioFilepath != None): + audioPixbuf = gtk.gdk.pixbuf_new_from_file(audioFilepath) else: if (self.datastoreOb == None): self.ca.m.loadMediaFromDatastore( self ) @@ -153,12 +153,24 @@ class Recorded: import base64 data = base64.b64decode(self.datastoreOb.metadata['audioImage']) pbl.write(data) + pbl.close() + audioPixbuf = pbl.get_pixbuf() + + return audioPixbuf + + + def getAudioImageFilepath( self ): + if (self.datastoreId == None): + audioFilepath = os.path.join(self.ca.journalPath, self.audioImageFilename) + return os.path.abspath(audioFilepath) + else: + pixbuf = self.getAudioImagePixbuf() + if (pixbuf == None): + return None audioImageFilepath = os.path.join(self.ca.journalPath, "audioImage.png") - thumbImg.save(audioImageFilepath, "png", {} ) + pixbuf.save(audioImageFilepath, "png", {} ) return audioImageFilepath - return None - def getMediaFilepath( self, meshReq ): print("getMediaFilepath 1") |