diff --git a/src/calibre/devices/prs505/driver.py b/src/calibre/devices/prs505/driver.py index 094c12cf0c..f90a8ab263 100644 --- a/src/calibre/devices/prs505/driver.py +++ b/src/calibre/devices/prs505/driver.py @@ -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( diff --git a/src/calibre/ebooks/oeb/transforms/rescale.py b/src/calibre/ebooks/oeb/transforms/rescale.py index 55aafded5c..c3b4d6d40c 100644 --- a/src/calibre/ebooks/oeb/transforms/rescale.py +++ b/src/calibre/ebooks/oeb/transforms/rescale.py @@ -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() diff --git a/src/calibre/gui2/device.py b/src/calibre/gui2/device.py index 196e97f2a3..b20cd7594f 100644 --- a/src/calibre/gui2/device.py +++ b/src/calibre/gui2/device.py @@ -1232,7 +1232,7 @@ class DeviceMixin(object): # {{{ self.location_manager.update_devices(cp, fs, self.device_manager.device.icon) # reset the views so that up-to-date info is shown. These need to be - # here because the sony driver updates collections in sync_booklists + # here because some drivers update collections in sync_booklists self.memory_view.reset() self.card_a_view.reset() self.card_b_view.reset() diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index 5fa514ae8a..e9e688c93b 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -1030,7 +1030,9 @@ class DeviceBooksModel(BooksModel): # {{{ def resort(self, reset=True): if self.sorted_on: self.sort(self.column_map.index(self.sorted_on[0]), - self.sorted_on[1], reset=reset) + self.sorted_on[1], reset=False) + if reset: + self.reset() def columnCount(self, parent): if parent and parent.isValid():