Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-08-2010, 08:34 PM   #1
phnord
Junior Member
phnord began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2010
Device: iPhone
Setting first HTML file Image as Cover?

Hey guys,

I have a large amount of HTML files (500 or so) that I want to convert to ePub's for my iPhone stanza app - and Calibre has been doing great with it.

However, there's one thing I'd like to be able to do. Each HTML file has a single image in it. This image precedes the content of the rest of the page.

I would like to be able to automatically set each ePub's cover to be this image.

I can't seem to find a way to do this in Calibre. The closest has been to the following:
- Import them into Calibre normally
- Convert the books to ePub w/ the No Cover Page option
- Individually edit the meta-data of each to grab the first image from the ePub format

There are two problems with this method:
- It is not feasible to edit the metadata individually of all five-hundred books
- The resulting cover image is just a snapshot of the top of the page - sometimes it cuts off the image, sometimes it grabs some of the rest of the page, etc.


Is there a way to do this in Calibre? If not, could someone point me in the right direction of a program that I can use to do this?

I also may be able to write a shell-script, php script, etc. to do this myself if someone could point me in the right direction...

Thanks!
phnord is offline   Reply With Quote
Old 01-09-2010, 02:13 AM   #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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Just write a shell script to set the covers programatically in calibre using the calibredb command. Once hte covers are set, a bulk convert will use those covers.
kovidgoyal is offline   Reply With Quote
Advert
Old 01-09-2010, 03:13 AM   #3
phnord
Junior Member
phnord began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2010
Device: iPhone
Quote:
Originally Posted by kovidgoyal View Post
Just write a shell script to set the covers programatically in calibre using the calibredb command. Once hte covers are set, a bulk convert will use those covers.
How would I set a cover of an item using calibredb? I can't seem to find information on this. The image I would want to use would want to use would be the only .jpg that exists within the ZIP archive of the book that Calibre has created.

Could you give me an example of the syntax for the calibredb commands I'd need to use - both to get the name of the .jpg bundled in the .zip archive and to set the cover to a .jpg of that name?

Thank you!
phnord is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merging multiple HTML files into one HTML file skoobwoman Workshop 45 07-11-2014 10:46 AM
Setting Image width on news feed Wiggles Calibre 2 08-13-2010 02:10 AM
Extracting a cover image from lit file p3aul Calibre 6 07-25-2010 04:33 PM
Calibre viewer setting file time banjomike Calibre 6 06-14-2010 05:18 PM
How can i convert HTML or txt file to EPUB file ? guguqiaqia ePub 7 05-28-2010 09:15 PM


All times are GMT -4. The time now is 04:05 PM.


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