Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 10-16-2017, 01:39 PM   #1
olin-shivers
Junior Member
olin-shivers began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2014
Device: kindle
Running the cover generator standalone on linux

I'd like to make book-cover images using calibre's cover generator. I *don't* want to do it from the GUI, however. Is there some way I can run the cover generator as a separate program in linux, feeding it author/title/series metadata as command-line arguments, along with the name of the image file for it to produce?

The cover generator's current status as a plugin works fine for doing in-calibre conversions from the GUI. But won't work if one is simply trying to produce a book using other production techniques, outside of calibre, with a GUI-free workflow.

I'm not committed to the calibre cover generator, for that matter. It makes fine covers, but if there's a non-calibre way to make cover jpegs, I'd also be interested in that.

Thanks!

Olin
olin-shivers is offline   Reply With Quote
Old 10-16-2017, 01:41 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Simply convert to EPUB without any cover in the input document and ebook-convert will generate a cover automatically.
kovidgoyal is offline   Reply With Quote
Old 10-16-2017, 02:27 PM   #3
olin-shivers
Junior Member
olin-shivers began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2014
Device: kindle
Quote:
Originally Posted by kovidgoyal View Post
Simply convert to EPUB without any cover in the input document and ebook-convert will generate a cover automatically.
Hi, Kovid. Thanks for your instantaneous reply!

What you suggest will produce an *epub* file. Which will unzip into a directory containing a file images/calibre_cover.jpg. I'm just looking for a program that will produce that calibre_cover.jpg file directly, and nothing else. Clearly that is happening at some point in the execution of ebook-convert.

Is there some way to do this? (As a workaround, I *could* use ebook-convert to do an epub->epub conversion on a trivial book, then extract images/calibre_cover.jpg from the result. But that seems like a bit of a hack.)

(I see mention of SVG format covers in the manual, but what ebook-convert makes for me is a jpg.)

Secondarily, it would be nice if there was some way to choose among the various styles (banner, cross, blocks, etc.) of cover image that ebook-convert knows how to produce, and select the color.

Olin

P.S. While I'm writing: are there any plans to have calibre support the current epub standard, 3.1? E.g., a way to have ebook-convert produce books in this format?
olin-shivers is offline   Reply With Quote
Old 10-16-2017, 11:05 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I dont see what's so hacky about it. But if you really want to run just the cover generator, do it like this.

Code:
calibre-debug -c "from calibre.ebooks.covers import *; open('cover.jpg', 'wb').write(create_cover('my title', ['my author'])))"

And you can set whatever preferences you like when using the create_cover function, see the sourcecode for details.

As for EPUB 3 sure someday, but since the EPUB standards are a bad joke and there is nothing you can do in EPUB 3 that you cant do in EPUB 2 I'm not particularly motivated to do so.
kovidgoyal is offline   Reply With Quote
Old 10-18-2017, 11:34 AM   #5
olin-shivers
Junior Member
olin-shivers began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2014
Device: kindle
Quote:
Originally Posted by kovidgoyal View Post
I dont see what's so hacky about it. But if you really want to run just the cover generator, do it like this.

Code:
calibre-debug -c "from calibre.ebooks.covers import *; open('cover.jpg', 'wb').write(create_cover('my title', ['my author'])))"

And you can set whatever preferences you like when using the create_cover function, see the sourcecode for details.
Just what I was seeking. Thanks very much.
olin-shivers is offline   Reply With Quote
Old 10-31-2017, 09:59 AM   #6
olin-shivers
Junior Member
olin-shivers began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2014
Device: kindle
Quote:
Originally Posted by kovidgoyal View Post
I dont see what's so hacky about it. But if you really want to run just the cover generator, do it like this.

Code:
calibre-debug -c "from calibre.ebooks.covers import *; open('cover.jpg', 'wb').write(create_cover('my title', ['my author'])))"

And you can set whatever preferences you like when using the create_cover function, see the sourcecode for details.
Kovid-

One more question: can you tell me how to make this code cause SVG output?

-Olin
olin-shivers is offline   Reply With Quote
Old 10-31-2017, 10:02 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
covers are generated as raster images, there is no svg output
kovidgoyal is offline   Reply With Quote
Old 10-31-2017, 10:26 AM   #8
olin-shivers
Junior Member
olin-shivers began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2014
Device: kindle
Quote:
Originally Posted by kovidgoyal View Post
covers are generated as raster images, there is no svg output
Wait... then why does ebook-convert have a --no-svg-cover flag? I'm confused.

-Olin
olin-shivers is offline   Reply With Quote
Old 10-31-2017, 10:50 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That refers to the wrappedr code used to display the image inside the epub
kovidgoyal is offline   Reply With Quote
Old 10-31-2017, 11:02 AM   #10
olin-shivers
Junior Member
olin-shivers began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2014
Device: kindle
Quote:
Originally Posted by kovidgoyal View Post
That refers to the wrappedr code used to display the image inside the epub
Ahh! Thank you, again!

Olin
olin-shivers is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem on Cover Generator qprfan99 Calibre 2 10-09-2017 07:42 AM
Building the Linux standalone Sigil installer eschwartz Sigil 10 12-20-2015 04:13 PM
New (built-in) Cover Generator weberr Calibre 8 11-08-2014 10:55 PM
Build Sigil as standalone binary (on Linux) mustai Sigil 1 05-12-2014 02:20 AM
Standalone Server(linux) version just for collecting news? bigreat Calibre 8 02-25-2010 01:03 PM


All times are GMT -4. The time now is 11:26 PM.


MobileRead.com is a privately owned, operated and funded community.