View Single Post
Old 12-04-2012, 08:41 AM   #570
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1345754
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
@FaceDeer - which approach you take depends on what you want to do. If like theducks said you just want to find epubs that have more than one image, then it would be trivial to hack that into this plugin. If you look in check_epub.py and the check_epub_unused_images function you have a more complex example of everything you need - it builds up a list of all the images in the epub (as well as a list of html files in its case which you don't need), you can just check the length of the list and if >1 then return True. Put that in a new function, add it to the config.py file so it appears in the menu and job done. Running the check would then display all epubs with more than one image, which you could use bulk edit to add a tag to or whatever. Of course when I release a new version of Quality Check you will have to reintegrate your changes each time, but I can't see any general interest in this feature of finding a count of images greater than a threshold to put it into the main release?

If instead you want that count recorded in a custom column or you want it to run in the background then doing a version of Count Pages for your own requirements would work. However it would be a lot more work.

I will say if you go down the latter approach then rather than posting on the Count Pages thread, post any questions in the development forum since you are making a new plugin. Just keeps the noise down in that Count Pages thread.
kiwidude is offline   Reply With Quote