mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-25 02:57:22 +00:00
small change
This commit is contained in:
parent
4a0dde0371
commit
764389ea2a
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
from __future__ import division, print_function, unicode_literals
|
from __future__ import division, print_function, unicode_literals
|
||||||
import os
|
import os
|
||||||
|
from urllib.request import urlopen
|
||||||
|
|
||||||
from .. import constants
|
from .. import constants
|
||||||
from cps import config, db, fs, gdriveutils, logger, ub
|
from cps import config, db, fs, gdriveutils, logger, ub
|
||||||
@ -25,10 +26,6 @@ from cps.services.worker import CalibreTask, STAT_CANCELLED, STAT_ENDED
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from sqlalchemy import func, text, or_
|
from sqlalchemy import func, text, or_
|
||||||
|
|
||||||
try:
|
|
||||||
from urllib.request import urlopen
|
|
||||||
except ImportError as e:
|
|
||||||
from urllib2 import urlopen
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from wand.image import Image
|
from wand.image import Image
|
||||||
@ -372,7 +369,8 @@ class TaskGenerateSeriesThumbnails(CalibreTask):
|
|||||||
dimensions = get_best_fit(width, height, img.width, img.height)
|
dimensions = get_best_fit(width, height, img.width, img.height)
|
||||||
|
|
||||||
# resize and crop the image
|
# resize and crop the image
|
||||||
img.resize(width=int(dimensions['width']), height=int(dimensions['height']), filter='lanczos')
|
img.resize(width=int(dimensions['width']), height=int(dimensions['height']),
|
||||||
|
filter='lanczos')
|
||||||
img.crop(width=int(width / 2.0), height=int(height / 2.0), gravity='center')
|
img.crop(width=int(width / 2.0), height=int(height / 2.0), gravity='center')
|
||||||
|
|
||||||
# add the image to the canvas
|
# add the image to the canvas
|
||||||
|
Loading…
Reference in New Issue
Block a user