![]() |
#1 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7
Karma: 11514
Join Date: Mar 2013
Device: KOBO GLO
|
How-to Auto-add cover.jpg?
I've got one folder with (many) sub-folders each containing a:
name - author.txt file cover.jpg I've been using the [Add books - each subdir contains one ebook] option How can I cause Calibre when it adds the .txt file (or other formats like HTML, PDF) to the library to also include the cover.jpg if it exists in the source folder? I thought this might be the default action but apparently not? (I had also tried naming the covers as "name - author.jpg" but also no joy) If I use [Edit metadata] and manually browse to the folder still containing the cover.jpg and select it, cover.jpg is copied to the Calibre folder and AFAICT (by comparing old and new metadata.opf) metadata.opf is left unchanged. ... later ... looks like *ANY* jpg selected will be saved as cover.jpg regardless of its original name (which makes sense I guess) Thanks ... Alec Last edited by buralex; 03-02-2013 at 01:01 PM. Reason: typo |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,295
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You need to have an OPF file that refers to the cover in its <guide> section in the folder.
|
![]() |
![]() |
![]() |
#3 | |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7
Karma: 11514
Join Date: Mar 2013
Device: KOBO GLO
|
Quote:
PHP Code:
My problem is that the cover.jpg does not get get copied when the OPF file is first created. CORRECT? What is non-trivial (to me) is figuring out what the name of the containing folder will be in the library and then creating some kind of .bat file that will copy cover.jpg from the original location to the Calibre-Library location. Thanks .. Alec |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,295
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I'm talking about an OPF in the original folder you are adding from. If there is an OPF file refering to a cover in that folder, then calibre will import the cover. Ptherwise you have to add it manually later.
|
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7
Karma: 11514
Join Date: Mar 2013
Device: KOBO GLO
|
Quote:
If I create a minimal .OPF file consisting of *JUST* the guide section. IE. the same .OPF file could (hopefully) be used for all the folders containing text files, would Calibre fill in the rest? By comparing two .OPF files from different books, it looks like this might be syntactically legal: Code:
<?xml version='1.0' encoding='utf-8'?> <package xmlns="http://www.idpf.org/2007/opf" unique-identifier="uuid_id"> <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf"> </metadata> <guide> <reference href="cover.jpg" type="cover" title="Cover"/> </guide> </package> I've only been using Calibre for a week or so (got my first e-reader three weeks ago). If above approach is a non-starter, is there a method for requesting feature requests for Calibre or help constructing a plugin which would be called from the Add logic and handle the import of a cover.jpg? Thanks ... Alec |
|
![]() |
![]() |
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,295
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Try it and see. Though if you want to script it, use calibredb.exe to write a script to import your books and add covers however you want.
|
![]() |
![]() |
![]() |
#7 | |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7
Karma: 11514
Join Date: Mar 2013
Device: KOBO GLO
|
Quote:
With notetab clips / some regex and a dir listing I s/b able to massage them into a .BAT file that does just what I want. Thanks ... Alec |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
JPG image lost when add HTML file to Calibre | mshane | Conversion | 8 | 01-03-2013 06:08 PM |
Is this possible: Auto-add book/magazine then auto e-mail to device? | runningwithbulls | Library Management | 5 | 09-10-2012 12:27 PM |
Using the book name for the cover.jpg | Bigo2 | Calibre | 7 | 12-31-2011 09:06 PM |
JPG cover files not removed from Novel | js4c | Calibre | 5 | 08-03-2010 09:27 PM |
Can't update cover if file cover.jpg is already in the directory ? | q345 | Calibre | 14 | 06-08-2010 06:23 AM |