diff --git a/src/calibre/ebooks/oeb/iterator.py b/src/calibre/ebooks/oeb/iterator.py index f794f7e605..372baf0959 100644 --- a/src/calibre/ebooks/oeb/iterator.py +++ b/src/calibre/ebooks/oeb/iterator.py @@ -174,11 +174,13 @@ class EbookIterator(object): plumber.opts, plumber.input_fmt, self.log, {}, self.base) - if hasattr(self.pathtoopf, 'manifest'): - self.pathtoopf = write_oebbook(self.pathtoopf, self.base) - elif processed or plumber.input_fmt.lower() in ('pdf', 'rb'): + if processed or plumber.input_fmt.lower() in ('pdf', 'rb') and \ + not hasattr(self.pathtoopf, 'manifest'): self.pathtoopf = create_oebbook(self.log, self.pathtoopf, plumber.opts, plumber.input_plugin) + if hasattr(self.pathtoopf, 'manifest'): + self.pathtoopf = write_oebbook(self.pathtoopf, self.base) + self.opf = OPF(self.pathtoopf, os.path.dirname(self.pathtoopf)) self.language = self.opf.language