Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-02-2013, 01:00 PM   #1
buralex
Junior Member
buralex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to behold
 
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
buralex is offline   Reply With Quote
Old 03-02-2013, 01:05 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: 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.
kovidgoyal is offline   Reply With Quote
Old 03-04-2013, 11:21 PM   #3
buralex
Junior Member
buralex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to behold
 
Posts: 7
Karma: 11514
Join Date: Mar 2013
Device: KOBO GLO
Quote:
Originally Posted by kovidgoyal View Post
You need to have an OPF file that refers to the cover in its <guide> section in the folder.
From what I can see, starting from the folder containing the textfile.txt and cover.jpg and using the [Add] function Calibre does create an OPF file containing:
PHP Code:
<guide>
        <
reference href="cover.jpg" type="cover" title="Cover"/>
    </
guide
whether of not the folder contained a cover.jpg file so that if I subsequently manually copy in a cover.jpg file everything is good and from then on (converting to other ebook formats, copying to device etc.) the cover.jpg will bet moved as it should.

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
buralex is offline   Reply With Quote
Old 03-04-2013, 11:25 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: 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.
kovidgoyal is offline   Reply With Quote
Old 03-05-2013, 01:39 AM   #5
buralex
Junior Member
buralex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to behold
 
Posts: 7
Karma: 11514
Join Date: Mar 2013
Device: KOBO GLO
Quote:
Originally Posted by kovidgoyal View Post
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. Otherwise you have to add it manually later.
OK - now I understand.
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>
What it doesn't contain of course are the identifier, title and author nor the number which appears to be appended to the title in the subfolder in the Calibre Library structure.

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
buralex is offline   Reply With Quote
Old 03-05-2013, 02:15 AM   #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: 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.
kovidgoyal is offline   Reply With Quote
Old 03-05-2013, 03:25 AM   #7
buralex
Junior Member
buralex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to beholdburalex is a marvel to behold
 
Posts: 7
Karma: 11514
Join Date: Mar 2013
Device: KOBO GLO
Quote:
Originally Posted by kovidgoyal View Post
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.
GREAT! looks like calibredb add [options] file1 file2 file3 ... with options -a -t -c (and possibly -s -S) is exactly what I need.

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
buralex is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 06:32 PM.


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