diff --git a/ebook_converter/ebooks/conversion/plugins/pml_output.py b/ebook_converter/ebooks/conversion/plugins/pml_output.py index 1b7a8c0..03e9e31 100644 --- a/ebook_converter/ebooks/conversion/plugins/pml_output.py +++ b/ebook_converter/ebooks/conversion/plugins/pml_output.py @@ -62,7 +62,7 @@ class PMLOutput(OutputFormatPlugin): im = Image.open(io.BytesIO(item.data)) else: im = Image.open(io.BytesIO(item.data)).convert('P') - im.thumbnail((300,300), Image.ANTIALIAS) + im.thumbnail((300,300), Image.LANCZOS) data = io.BytesIO() im.save(data, 'PNG') diff --git a/ebook_converter/ebooks/lrf/html/convert_from.py b/ebook_converter/ebooks/lrf/html/convert_from.py index 73aa38e..98ad266 100644 --- a/ebook_converter/ebooks/lrf/html/convert_from.py +++ b/ebook_converter/ebooks/lrf/html/convert_from.py @@ -1012,7 +1012,7 @@ class HTMLConverter(object): self.image_memory.append(pt) # Neccessary, trust me ;-) try: im.resize((int(width), int(height)), - PILImage.ANTIALIAS).save(pt, encoding) + PILImage.LANCZOS).save(pt, encoding) pt.close() self.scaled_images[path] = pt return pt.name @@ -1970,7 +1970,7 @@ def process_file(path, options, logger): options.cover = cf.name tim = im.resize((int(0.75 * th), th), - PILImage.ANTIALIAS).convert('RGB') + PILImage.LANCZOS).convert('RGB') tf = PersistentTemporaryFile(prefix=__appname__ + '_', suffix=".jpg") tf.close() diff --git a/ebook_converter/ebooks/lrf/html/table.py b/ebook_converter/ebooks/lrf/html/table.py index c305da9..9cc520b 100644 --- a/ebook_converter/ebooks/lrf/html/table.py +++ b/ebook_converter/ebooks/lrf/html/table.py @@ -145,7 +145,7 @@ class Cell(object): continue word = token.split() word = word[0] if word else "" - width = font.getsize(word)[0] + width = font.getbbox(word)[2] if width > mwidth: mwidth = width return parindent + mwidth + 2 @@ -191,7 +191,7 @@ class Cell(object): if (ff, fs) != (ts['fontfacename'], ts['fontsize']): font = get_font(ff, self.pts_to_pixels(fs)) for word in token.split(): - width, height = font.getsize(word) + _, _, width, height = font.getbbox(word) left, right, top, bottom = add_word(width, height, left, right, top, bottom, ls, ws) return right+3+max(parindent, 10), bottom