Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 01-31-2016, 02:51 PM   #1
botmtl
Enthusiast
botmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel is
 
botmtl's Avatar
 
Posts: 43
Karma: 70238
Join Date: Jun 2014
Device: none
ebook-meta.exe and related dlls

I tought about writing this post as a private message, because there is only one person in the world likely to be able to answer it, but it's probably better to leave the information here in case someone has a similar question in the future.

I've been wanting to write shell extensions for the various formats calibre handles for a while now. I know there are a few floating around (I have seen a thumbnail handler and a couple ifilters) but I haven't found one any would actually use because either they have aren't open source (or not readily trustable), or they leak file handles and/or memory like mad, or they don't extract the same information calibre does at import time.

When I saw ebook-meta.exe I thought I might have hit the jackpot and I would be able to save a lot of time by shamelessly borrowing (ripping off is more appropriate a term) your hard work by hooking in to same functions you are ==> essentially the shell extensions would be wrappers around calibre code.

Wasn't long before I hit a snag however, ebook-meta's isn't like I hoped it would be (an isolated, almost independent section of calibre responsible for handling metadata) - it's more akin to a shortcut launching the calibre environment with one of it's very first call being a call to calibre-launcher.dll which goes on to load a fair chunk of qt and other libraries. It wouldn't really matter if I was only doing a property sheet (slow loading wouldn't be a real issue there) but for a search ifilter it's not appropriate or fast enough.

I stopped my little research there and didn't look much further before coming here. Basically I would like your advice on how to proceed. Should I investigate this approach any further? Am I going to find a neat little python library in the source that does a lot of what I need? Some likely answers for you to copy/paste:
- "forget it, do your own thing", you won't be able to isolate metadata reading/writing from calibre code (or it's going to be more work than to actually writing it yourself).
- "take a look at folder XYZ in the source, some of what you need to do is in there" (with so many meta.py and metadata.py classes in the source i'm having trouble isolating what I need)
- "go away, I have no interest in shell extensions".
- etc.
botmtl is offline   Reply With Quote
Old 01-31-2016, 02:58 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: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you want speed in a process that is started up for every file, you dont want to implement things in python, the startup cost of python processes is too high. And note that reading metadata from ebook files actually does require things like Qt. For example, for some epub files, the only way to get the cover is to render the first html file in the epub, for which you need a browser (Qt WebKit). Similarly, for PDF getting the cover requires rendering the first page of the PDF.

If you do want to persist with using python, then you might as well just use ebook-meta.exe you wont gain very much in the way of performance by extracting the metadata reading code from calibre into a separate python project. But if you want to do that, the metadata reading code for all the various formats is in metadata/*.py (although that code depends on facilities provided by various parts of calibre so extracting it wont be trivial).
kovidgoyal is offline   Reply With Quote
Old 01-31-2016, 03:00 PM   #3
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
And just FYI, *all* the calibre executables are just entry points that load calibre python code (except for calibre-eject.exe)
kovidgoyal is offline   Reply With Quote
Old 01-31-2016, 03:15 PM   #4
botmtl
Enthusiast
botmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel is
 
botmtl's Avatar
 
Posts: 43
Karma: 70238
Join Date: Jun 2014
Device: none
Thank you! You just saved me a lot of time. I'll take a look at metadata/*.py and try some stuff out.
botmtl is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre2\ebook-viewer.exe pdrapoza Related Tools 2 12-09-2014 06:40 PM
(Suggestion) Move ebook-viewer.exe to the main directory next to calibre-portable.exe avid01 Library Management 6 07-03-2014 03:55 AM
Batch breaks after ebook-convert.exe j0s3f Calibre 1 05-04-2011 05:27 PM
set meta data with ebook-meta and ebook-convert krischik Calibre 6 01-19-2010 11:40 AM
Calibre Qt DLLs override the system Qt DLLs Valloric Calibre 2 03-10-2009 05:12 PM


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


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