mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
214ba4e825
@ -35,7 +35,7 @@ class PRS505(USBMS):
|
|||||||
|
|
||||||
VENDOR_NAME = 'SONY'
|
VENDOR_NAME = 'SONY'
|
||||||
WINDOWS_MAIN_MEM = re.compile(
|
WINDOWS_MAIN_MEM = re.compile(
|
||||||
r'(PRS-(505|500))|'
|
r'(PRS-(505|500|300))|'
|
||||||
r'(PRS-((700[#/])|((6|9|3)(0|5)0&)))'
|
r'(PRS-((700[#/])|((6|9|3)(0|5)0&)))'
|
||||||
)
|
)
|
||||||
WINDOWS_CARD_A_MEM = re.compile(
|
WINDOWS_CARD_A_MEM = re.compile(
|
||||||
|
@ -72,10 +72,13 @@ class RescaleImages(object):
|
|||||||
Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
|
Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
|
||||||
data = pixmap_to_data(img, format=ext)
|
data = pixmap_to_data(img, format=ext)
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
im = im.resize((int(new_width), int(new_height)), PILImage.ANTIALIAS)
|
im = im.resize((int(new_width), int(new_height)), PILImage.ANTIALIAS)
|
||||||
of = cStringIO.StringIO()
|
of = cStringIO.StringIO()
|
||||||
im.convert('RGB').save(of, ext)
|
im.convert('RGB').save(of, ext)
|
||||||
data = of.getvalue()
|
data = of.getvalue()
|
||||||
|
except:
|
||||||
|
self.log.exception('Failed to rescale image')
|
||||||
if data is not None:
|
if data is not None:
|
||||||
item.data = data
|
item.data = data
|
||||||
item.unload_data_from_memory()
|
item.unload_data_from_memory()
|
||||||
|
@ -1232,7 +1232,7 @@ class DeviceMixin(object): # {{{
|
|||||||
self.location_manager.update_devices(cp, fs,
|
self.location_manager.update_devices(cp, fs,
|
||||||
self.device_manager.device.icon)
|
self.device_manager.device.icon)
|
||||||
# reset the views so that up-to-date info is shown. These need to be
|
# 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.memory_view.reset()
|
||||||
self.card_a_view.reset()
|
self.card_a_view.reset()
|
||||||
self.card_b_view.reset()
|
self.card_b_view.reset()
|
||||||
|
@ -1030,7 +1030,9 @@ class DeviceBooksModel(BooksModel): # {{{
|
|||||||
def resort(self, reset=True):
|
def resort(self, reset=True):
|
||||||
if self.sorted_on:
|
if self.sorted_on:
|
||||||
self.sort(self.column_map.index(self.sorted_on[0]),
|
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):
|
def columnCount(self, parent):
|
||||||
if parent and parent.isValid():
|
if parent and parent.isValid():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user