mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:...
This commit is contained in:
parent
3938bbdaeb
commit
0749f44979
@ -133,6 +133,14 @@ class InputFormatPlugin(Plugin):
|
|||||||
#: (option_name, recommended_value, recommendation_level)
|
#: (option_name, recommended_value, recommendation_level)
|
||||||
recommendations = set([])
|
recommendations = set([])
|
||||||
|
|
||||||
|
def get_images(self):
|
||||||
|
'''
|
||||||
|
Return a list of absolute paths to the images, if this input plugin
|
||||||
|
represents an image collection. The list of images is in the same order
|
||||||
|
as the spine and the TOC.
|
||||||
|
'''
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
def convert(self, stream, options, file_ext, log, accelerators):
|
def convert(self, stream, options, file_ext, log, accelerators):
|
||||||
'''
|
'''
|
||||||
This method must be implemented in sub-classes. It must return
|
This method must be implemented in sub-classes. It must return
|
||||||
|
@ -357,6 +357,9 @@ class ComicInput(InputFormatPlugin):
|
|||||||
thumbnail = None
|
thumbnail = None
|
||||||
return new_pages
|
return new_pages
|
||||||
|
|
||||||
|
def get_images(self):
|
||||||
|
return self._images
|
||||||
|
|
||||||
def convert(self, stream, opts, file_ext, log, accelerators,
|
def convert(self, stream, opts, file_ext, log, accelerators,
|
||||||
progress=lambda p, m : m):
|
progress=lambda p, m : m):
|
||||||
from calibre.ebooks.metadata import MetaInformation
|
from calibre.ebooks.metadata import MetaInformation
|
||||||
@ -401,6 +404,9 @@ class ComicInput(InputFormatPlugin):
|
|||||||
spine = []
|
spine = []
|
||||||
for comic in comics:
|
for comic in comics:
|
||||||
spine.extend(map(href, comic[2]))
|
spine.extend(map(href, comic[2]))
|
||||||
|
self._images = []
|
||||||
|
for comic in comics:
|
||||||
|
self._images.extend(comic[1])
|
||||||
opf.create_spine(spine)
|
opf.create_spine(spine)
|
||||||
toc = TOC()
|
toc = TOC()
|
||||||
if len(comics) == 1:
|
if len(comics) == 1:
|
||||||
|
@ -60,6 +60,9 @@ class PDFOutput(OutputFormatPlugin):
|
|||||||
])
|
])
|
||||||
|
|
||||||
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
||||||
|
self.opts, self.log = opts, log
|
||||||
|
if input_plugin.is_image_collection:
|
||||||
|
self.convert_images(input_plugin.get_images())
|
||||||
with TemporaryDirectory('_pdf_out') as oebdir:
|
with TemporaryDirectory('_pdf_out') as oebdir:
|
||||||
OEBOutput(None).convert(oeb_book, oebdir, input_plugin, opts, log)
|
OEBOutput(None).convert(oeb_book, oebdir, input_plugin, opts, log)
|
||||||
|
|
||||||
|
@ -9,10 +9,9 @@ __docformat__ = 'restructuredtext en'
|
|||||||
Write content to PDF.
|
Write content to PDF.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import os, shutil, sys
|
import os, shutil
|
||||||
|
|
||||||
from calibre.ptempfile import PersistentTemporaryDirectory
|
from calibre.ptempfile import PersistentTemporaryDirectory
|
||||||
from calibre.customize.profiles import OutputProfile
|
|
||||||
from calibre.ebooks.pdf.pageoptions import unit, paper_size, \
|
from calibre.ebooks.pdf.pageoptions import unit, paper_size, \
|
||||||
orientation, size
|
orientation, size
|
||||||
from calibre.ebooks.metadata import authors_to_string
|
from calibre.ebooks.metadata import authors_to_string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user