diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index 402dd35f45..4d8b8a0113 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -244,7 +244,7 @@ class KindleDXOutput(OutputProfile): # Screen size is a best guess screen_size = (744, 1022) dpi = 150.0 - comic_screen_size = (744, 1022) + comic_screen_size = (741, 1022) @classmethod def tags_to_string(cls, tags): diff --git a/src/calibre/ebooks/conversion/preprocess.py b/src/calibre/ebooks/conversion/preprocess.py index cad247c48d..82637016cc 100644 --- a/src/calibre/ebooks/conversion/preprocess.py +++ b/src/calibre/ebooks/conversion/preprocess.py @@ -56,6 +56,7 @@ def line_length(raw, percent): if not lengths: return 0 + lengths = list(set(lengths)) total = sum(lengths) avg = total / len(lengths) max_line = avg * 2 @@ -189,7 +190,7 @@ class HTMLPreProcessor(object): if length: line_length_rules = [ # Un wrap using punctuation - (re.compile(r'(?<=.{%i}[a-z,;:-IA])\s*(?P)?\s*()\s*(?=(<(i|b|u)>)?[\w\d])' % length, re.UNICODE), wrap_lines), + (re.compile(r'(?<=.{%i}[a-z\.,;:)-IA])\s*(?P)?\s*()\s*(?=(<(i|b|u)>)?\s*[\w\d(])' % length, re.UNICODE), wrap_lines), ] rules = self.PDFTOHTML + line_length_rules diff --git a/src/calibre/ebooks/oeb/iterator.py b/src/calibre/ebooks/oeb/iterator.py index af8dd84162..2b68b6cf57 100644 --- a/src/calibre/ebooks/oeb/iterator.py +++ b/src/calibre/ebooks/oeb/iterator.py @@ -135,7 +135,7 @@ class EbookIterator(object): plumber.opts, plumber.input_fmt, self.log, {}, self.base) - if plumber.input_fmt.lower() == 'pdf': + if plumber.input_fmt.lower() in ('pdf', 'rb'): self.pathtoopf = create_oebbook(self.log, self.pathtoopf, plumber.opts, plumber.input_plugin) if hasattr(self.pathtoopf, 'manifest'): diff --git a/src/calibre/gui2/convert/txt_output.py b/src/calibre/gui2/convert/txt_output.py index dd36dc8cfc..b3a79e1326 100644 --- a/src/calibre/gui2/convert/txt_output.py +++ b/src/calibre/gui2/convert/txt_output.py @@ -30,5 +30,5 @@ class PluginWidget(Widget, Ui_Form): self.opt_newline.setModel(self.newline_model) default_index = self.opt_newline.findText(default) - self.opt_newline.setCurrentIndex(default_index if default_index != -1 else 0) - + system_index = self.opt_newline.findText('system') + self.opt_newline.setCurrentIndex(default_index if default_index != -1 else system_index if system_index != -1 else 0)