10-11-2022, 07:00 PM | #1 |
Member
Posts: 24
Karma: 10
Join Date: Jan 2019
Location: England
Device: KT4
|
ebook-convert metadata
When I convert a *.docx to an epub via the Calibre library software it picks up the files metadata - which is great, exactly what I want.
However, when I do the same conversion via the command line using 'ebook-convert' I can only get meta to appear if I've manually input it as part of the syntax. Should ebook-convert pick up file metadata? I've tried every which way to get this to work without success. |
10-11-2022, 10:47 PM | #2 | |
null operator (he/him)
Posts: 20,946
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
The command used was: ebook-convert blah.docx blah.epub BR |
|
10-12-2022, 07:31 PM | #3 |
Member
Posts: 24
Karma: 10
Join Date: Jan 2019
Location: England
Device: KT4
|
What meta do you see on the front cover of your epub? I'm only seeing the title and the author (although I can see that you have other metadata in the *.docx properties).
This is what I'm seeing with my *.docx too. In Calibre I have set up a cover that has the title at the top, tags and comments in the subtitle and then author at the bottom. But nothing from the subtitle is showing up at all when I generate from the CLI, only when I do it from the Calibre library. I don't understand why the command line conversion isn't picking up the same default cover as the library. Any ideas? |
10-12-2022, 08:29 PM | #4 |
null operator (he/him)
Posts: 20,946
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
What is in the cover sub-title template, mine has this:
Code:
{series:'test($, strcat("<i>", $, "</i> - ", raw_field("formatted_series_index")), "")'} BR |
10-12-2022, 09:13 PM | #5 |
Member
Posts: 24
Karma: 10
Join Date: Jan 2019
Location: England
Device: KT4
|
I've tried all sorts in the sub-title template (including your example), but I've gone back to basics and just have {authors} to see whether it would pick up a value that I know it's reading in (see screenshot attached).
Author still appears at the bottom of the cover but it doesn't appear in the middle sub-title section. I'm really puzzled! Is there some other setting in Calibre that might affect the output from the command line? What could cause the CLI output to be different to the cover generated from the library? (I'm on the latest version of Calibre, btw, and have no additional plugins installed). Any ideas gratefully received |
10-12-2022, 10:25 PM | #6 |
creator of calibre
Posts: 44,380
Karma: 23766374
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
When you convert in the GUI the generated cover is used directly. When you convert from the CLI there is no pre-genrated cover so a new one based on metadata is generated.
|
10-13-2022, 07:02 PM | #7 | |
Member
Posts: 24
Karma: 10
Join Date: Jan 2019
Location: England
Device: KT4
|
Quote:
After testing various different things from the CLI, I found that the only metadata that shows up in the sub-title is if I pass in both 'series' and 'series-index'. Is there any way to pass in anything else? Or hide the 'series-index'? Or to format the 'series' text, so that I can pass in other values concatenated together? e.g. if I passed in the equivalent of this pseudocode: --series "concatenated(rating, <br>, tags, <br>, comments)" thanks! |
|
10-13-2022, 11:11 PM | #8 |
creator of calibre
Posts: 44,380
Karma: 23766374
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There isnt. If you want to generate covers on the command line, generate them before hand and pass them to the conversion using --cover
A bit of googling should find the calibre-debug command you can use for generating covers, something like Code:
calibre-debug -c "from calibre.ebooks.covers import *; d = create_cover('my title', 'my authors', 'my series', 'my series index'); open('/tmp/cover.jpg', 'wb').write(d)" |
10-14-2022, 05:38 AM | #9 |
Member
Posts: 24
Karma: 10
Join Date: Jan 2019
Location: England
Device: KT4
|
Great! I will definitely investigate that.
Many thanks to both of you for your help with this |
Tags |
cli, ebook-convert, metadata |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Convert and custom metadata | Hortensia | Conversion | 2 | 11-07-2021 05:11 AM |
Troubleshooting Convert Metadata file .AZW3R into .MBP or "MyClippings.txt" into a Metadata file | LittleBeard | Amazon Kindle | 25 | 04-13-2020 10:41 AM |
Please don't downscale or convert my images, ebook-convert ! | nylnook | Conversion | 3 | 02-11-2016 06:08 AM |
Covers and metadata after convert | JCSullivan | Calibre | 4 | 08-16-2012 03:02 AM |
How to batch-convert with ebook-convert? | cypresstwist | Conversion | 8 | 02-22-2011 09:28 AM |