mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-28 06:33:15 +02:00
Start addressing review comments
Explicit cast to float is superfluous, thanks to __future__.division
This commit is contained in:
parent
04c7a8aa4a
commit
7c02419eed
1 changed files with 1 additions and 2 deletions
|
|
@ -2616,10 +2616,9 @@ def _calculate_kobo_cover_size(self, library_size, kobo_size, expand, keep_cover
|
|||
|
||||
# NOTE: Loosely based on Qt's QSize::scaled implementation
|
||||
if keep_cover_aspect:
|
||||
# NOTE: Py3k wouldn't need explicit casts to return a float
|
||||
# NOTE: Unlike Qt, we round to avoid accumulating errors,
|
||||
# as ImageOps will then floor via fit_image
|
||||
aspect_ratio = library_size[0] / float(library_size[1])
|
||||
aspect_ratio = library_size[0] / library_size[1]
|
||||
rescaled_width = int(round(kobo_size[1] * aspect_ratio))
|
||||
|
||||
if expand:
|
||||
|
|
|
|||
Loading…
Reference in a new issue