Author: duncan
Date: Sat Dec 16 16:20:37 2006
New Revision: 8734

Modified:
   branches/rel-1/freevo/src/audio/plugins/coversearch.py

Log:
Fixes for kaa.imlib2


Modified: branches/rel-1/freevo/src/audio/plugins/coversearch.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/coversearch.py      (original)
+++ branches/rel-1/freevo/src/audio/plugins/coversearch.py      Sat Dec 16 
16:20:37 2006
@@ -52,7 +52,6 @@
 import time
 import config
 import kaa.imlib2 as Image
-import cStringIO
 from xml.dom import minidom # ParseError used by amazon module
 
 from gui.PopupBox import PopupBox
@@ -225,7 +224,7 @@
                 # Amazon returned a 404
                 MissingFile = True
             if not MissingFile and not (m.info()['Content-Length'] == '807'):
-                image = Image.open(cStringIO.StringIO(m.read()))
+                image = Image.open_from_memory(m.read())
                 items += [ menu.MenuItem('%s' % cover[i].ProductName,
                                          self.cover_create, 
cover[i].ImageUrlLarge,
                                          image=image) ]
@@ -239,7 +238,7 @@
                 except urllib2.HTTPError:
                     MissingFile = True
                 if not MissingFile and not (n.info()['Content-Length'] == 
'807'):
-                    image = Image.open(cStringIO.StringIO(n.read()))
+                    image = Image.open_from_memory(n.read())
                     items += [ menu.MenuItem( ('%s [' + _( 'small' ) + ']') % 
cover[i].ProductName,
                                     self.cover_create, 
cover[i].ImageUrlMedium) ]
                     n.close()
@@ -251,7 +250,7 @@
                         n = urllib2.urlopen(cover[i].ImageUrlLarge)
 
                         if not (n.info()['Content-Length'] == '807'):
-                            image = Image.open(cStringIO.StringIO(n.read()))
+                            image = Image.open_from_memory(n.read())
                             items += [ menu.MenuItem( ('%s [' + _( 'small' ) + 
']' ) % cover[i].ProductName,
                                                      self.cover_create, 
cover[i].ImageUrlLarge) ]
                         n.close()

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to