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-11-2022, 07:00 PM   #1
littlenellie
Member
littlenellie began at the beginning.
 
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.
littlenellie is offline   Reply With Quote
Old 10-11-2022, 10:47 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,946
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by littlenellie View Post
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.
Works for me with with a docx created in current version of Word, see attachment

The command used was: ebook-convert blah.docx blah.epub

BR
Attached Files
File Type: zip blah.zip (66.5 KB, 684 views)
BetterRed is offline   Reply With Quote
Old 10-12-2022, 07:31 PM   #3
littlenellie
Member
littlenellie began at the beginning.
 
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?
littlenellie is offline   Reply With Quote
Old 10-12-2022, 08:29 PM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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")), "")'}
But because the DOCX specs doesn't have Series as a metadata element, that's never going have anything in a CLI DOCX->EPUB conversion

BR
BetterRed is offline   Reply With Quote
Old 10-12-2022, 09:13 PM   #5
littlenellie
Member
littlenellie began at the beginning.
 
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
Attached Thumbnails
Click image for larger version

Name:	screenshot.png
Views:	101
Size:	34.7 KB
ID:	197124  
littlenellie is offline   Reply With Quote
Old 10-12-2022, 10:25 PM   #6
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: 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.
kovidgoyal is online now   Reply With Quote
Old 10-13-2022, 07:02 PM   #7
littlenellie
Member
littlenellie began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Jan 2019
Location: England
Device: KT4
Quote:
Originally Posted by kovidgoyal View Post
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.
Ah, I see.

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!
littlenellie is offline   Reply With Quote
Old 10-13-2022, 11:11 PM   #8
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: 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)"
kovidgoyal is online now   Reply With Quote
Old 10-14-2022, 05:38 AM   #9
littlenellie
Member
littlenellie began at the beginning.
 
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

littlenellie is offline   Reply With Quote
Reply

Tags
cli, ebook-convert, metadata


Forum Jump

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


All times are GMT -4. The time now is 04:13 AM.


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