Merge from trunk

This commit is contained in:
Charles Haley 2010-09-16 10:19:51 +01:00
commit db77526f70
2 changed files with 8 additions and 5 deletions

View File

@ -35,7 +35,7 @@ class PRS505(USBMS):
VENDOR_NAME = 'SONY'
WINDOWS_MAIN_MEM = re.compile(
r'(PRS-(505|500))|'
r'(PRS-(505|500|300))|'
r'(PRS-((700[#/])|((6|9|3)(0|5)0&)))'
)
WINDOWS_CARD_A_MEM = re.compile(

View File

@ -72,10 +72,13 @@ class RescaleImages(object):
Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
data = pixmap_to_data(img, format=ext)
else:
im = im.resize((int(new_width), int(new_height)), PILImage.ANTIALIAS)
of = cStringIO.StringIO()
im.convert('RGB').save(of, ext)
data = of.getvalue()
try:
im = im.resize((int(new_width), int(new_height)), PILImage.ANTIALIAS)
of = cStringIO.StringIO()
im.convert('RGB').save(of, ext)
data = of.getvalue()
except:
self.log.exception('Failed to rescale image')
if data is not None:
item.data = data
item.unload_data_from_memory()