From 3e686018d3505cc824373d6e796c5fd7227e7ab7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 12 Jun 2016 12:38:21 +0530 Subject: [PATCH] Fix passing data into remove_image_borders() not working --- src/calibre/utils/img.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/utils/img.py b/src/calibre/utils/img.py index ce2fdf03be..af153536e4 100644 --- a/src/calibre/utils/img.py +++ b/src/calibre/utils/img.py @@ -250,7 +250,8 @@ def remove_borders_from_image(img, fuzz=None): what colors are considered identical (must be a number between 0 and 255 in absolute intensity units). Default is from a tweak whose default value is 10. ''' fuzz = tweaks['cover_trim_fuzz_value'] if fuzz is None else fuzz - ans = imageops.remove_borders(image_from_data(img), max(0, fuzz)) + img = image_from_data(img) + ans = imageops.remove_borders(img, max(0, fuzz)) return ans if ans.size() != img.size() else img # }}}