mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Bulk trim legacy db
This commit is contained in:
parent
989e6de907
commit
0aa490214b
@ -433,6 +433,15 @@ class MyBlockingBusy(QDialog): # {{{
|
|||||||
if covers:
|
if covers:
|
||||||
self.db.set_cover(id, covers[-1][0])
|
self.db.set_cover(id, covers[-1][0])
|
||||||
covers = []
|
covers = []
|
||||||
|
elif cover_action == 'trim':
|
||||||
|
from calibre.utils.magick import Image
|
||||||
|
cdata = self.db.cover(id, index_is_id=True)
|
||||||
|
if cdata:
|
||||||
|
im = Image()
|
||||||
|
im.load(cdata)
|
||||||
|
im.trim(10)
|
||||||
|
cdata = im.export('png')
|
||||||
|
self.db.set_cover(id, cdata)
|
||||||
|
|
||||||
if do_remove_format:
|
if do_remove_format:
|
||||||
self.db.remove_format(id, remove_format, index_is_id=True,
|
self.db.remove_format(id, remove_format, index_is_id=True,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user