Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/recorded.py
diff options
context:
space:
mode:
authorerikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2007-11-06 19:32:49 (GMT)
committer erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2007-11-06 19:32:49 (GMT)
commitd1bee2c30e32b7d05beb709dbd0fbf7383cd7cd7 (patch)
tree1fb2e88c3efdc7e1dba8ac4091b3ce6d75070de9 /recorded.py
parent75606c87e12d7830fcf2e1b4d67459a239f7a446 (diff)
thumbnails from xml, not from datastore
git-svn-id: http://mediamods.com/public-svn/camera-activity/Record.activity@887 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'recorded.py')
-rw-r--r--recorded.py49
1 files changed, 6 insertions, 43 deletions
diff --git a/recorded.py b/recorded.py
index 441ca23..fcdc315 100644
--- a/recorded.py
+++ b/recorded.py
@@ -100,52 +100,15 @@ class Recorded:
#relaunch, their old media -- datastoreObject->file (hold onto the datastore object, delete if deleted) | ([request->]) Journal/session/buddy
def getThumbPixbuf( self ):
- record.Record.log.debug("getThumbPixbuf: self.datastoreId="+str(self.datastoreId))
- if (self.datastoreId == None):
- #just taken, so it is in the tempSessionDir
- #so load file, convert to pixbuf, and return it here...
- thumbPixbuf = None
- record.Record.log.debug("getThumbPixbuf: thumbfilename:" + str(self.thumbFilename))
- thumbFilepath = os.path.join(Instance.tmpPath, self.thumbFilename)
- if ( os.path.isfile(thumbFilepath) ):
- thumbPixbuf = gtk.gdk.pixbuf_new_from_file(thumbFilepath)
- record.Record.log.debug("getThumbPixbuf: returning thumbPixbuf->"+str(thumbPixbuf))
- return thumbPixbuf
- else:
- #todo: handle possible corruption of the preview into some other format
- if (self.datastoreOb == None):
- self.datastoreOb = serialize.getMediaFromDatastore( self )
- if (self.datastoreOb == None):
- record.Record.log.debug("getThumbPixbuf: datastoreOb==None")
- return None
-
- record.Record.log.debug("getThumbPixbuf: got datastore Ob!")
- return utils.getPixbufFromString( self.datastoreOb.metadata['preview'] )
+ thumbPixbuf = None
+ thumbFilepath = self.getThumbFilepath()
+ if ( os.path.isfile(thumbFilepath) ):
+ thumbPixbuf = gtk.gdk.pixbuf_new_from_file(thumbFilepath)
+ return thumbPixbuf
def getThumbFilepath( self ):
- if (self.datastoreId == None):
- #just taken, so it is in the tempSessionDir
- #so load file, convert to pixbuf, and return it here...
- thumbPixbuf = None
- record.Record.log.debug("getThumbFilepath: thumbfilename:" + str(self.thumbFilename))
- thumbFilepath = os.path.join(Instance.tmpPath, self.thumbFilename)
- if ( os.path.isfile(thumbFilepath) ):
- return thumbFilepath
- else:
- if (self.datastoreOb == None):
- self.datastoreOb = serialize.getMediaFromDatastore( self )
- if (self.datastoreOb == None):
- print("RecordActivity error -- unable to get datastore object in getThumbPixbuf")
- return None
-
- img = utils.getPixbufFromString( self.datastoreOb.metadata['preview'] )
- thumbFilepath = os.path.join( Instance.tmpPath, "thumb.png")
- thumbFilepath = utils.getUniqueFilepath(thumbFilepath, 0)
- img.save(thumbFilepath, "png", {} )
- return thumbFilepath
-
- return None
+ return os.path.join(Instance.tmpPath, self.thumbFilename)
def getAudioImagePixbuf( self ):