Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-08-2023, 01:11 PM   #1651
jecilop
Addict
jecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day now
 
Posts: 260
Karma: 139980
Join Date: Mar 2014
Device: Android
IGNORE OR DELETE POST.
UPDATE: removing original post..I realized my error in what I'm looking at. The #pages column had been off, but got turned on I guess during an update. Now I realize what is happening....so my post doesn't matter....

Last edited by jecilop; 07-08-2023 at 03:23 PM. Reason: UPDATE
jecilop is offline   Reply With Quote
Old 07-08-2023, 01:55 PM   #1652
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,397
Karma: 58055234
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
If the column name is not available to SET in count pages config, then the column is of the wrong type (or the DB is damaged)
theducks is offline   Reply With Quote
Advert
Old 07-08-2023, 03:23 PM   #1653
jecilop
Addict
jecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day now
 
Posts: 260
Karma: 139980
Join Date: Mar 2014
Device: Android
@the ducks.....I've updated my post..I've figured it out...I don't see how I can delete my post in the thread, so I just made it an update to ignore it.
Says:UPDATE: ignore post..I realized my error in what I'm looking at. The #pages column had been off, but got turned on I guess during an update. Now I realize what is happening....so my post doesn't matter....
jecilop is offline   Reply With Quote
Old 08-02-2023, 02:51 AM   #1654
Rivanov
Junior Member
Rivanov began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2021
Location: Netherlands
Device: Kobo Libra H2O
Is it possible to show the counted pages that has been stored in a column in Calibre, on my Kobo Libra H2O?
I don't see the counted pages on the Details page right now.

I use the KoboExtendedDriver (KePub).
Rivanov is offline   Reply With Quote
Old 08-02-2023, 04:55 AM   #1655
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,008
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Rivanov View Post
Is it possible to show the counted pages that has been stored in a column in Calibre, on my Kobo Libra H2O?
I don't see the counted pages on the Details page right now.

I use the KoboExtendedDriver (KePub).
Go to to the settings for the KoboTouchExtended Driver.

Go to the Metadata, on device & advanced tab

check Book stats

For Words, click Template Editor. Put in
Code:
program:floor($$#words)
For Pages, click Templace editor and put in
Code:
program:floor($$#pages)
#words and #pages are my columns. Put in whatever your columns are named.
JSWolf is offline   Reply With Quote
Advert
Old 08-02-2023, 05:01 AM   #1656
Rivanov
Junior Member
Rivanov began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2021
Location: Netherlands
Device: Kobo Libra H2O
Quote:
Originally Posted by JSWolf View Post
Go to to the settings for the KoboTouchExtended Driver.

Go to the Metadata, on device & advanced tab

check Book stats

For Words, click Template Editor. Put in
Code:
program:floor($$#words)
For Pages, click Templace editor and put in
Code:
program:floor($$#pages)
#words and #pages are my columns. Put in whatever your columns are named.
Thank you very much! Will try this!
Rivanov is offline   Reply With Quote
Old 08-30-2023, 05:06 AM   #1657
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,182
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
hey @kiwidude, hope you're fine.

i see this on the Wiki:

Alternatively in the configuration you can choose to use the page count used by the calibre e-book viewer

Is it actually possible that Count Pages can retrieve the same number of pages displayed in the Viewer header? Currently, it doesn't seem to do so. Perhaps the algorithm has been changed?
Comfy.n is online now   Reply With Quote
Old 08-30-2023, 06:02 AM   #1658
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,008
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Comfy.n View Post
hey @kiwidude, hope you're fine.

i see this on the Wiki:

Alternatively in the configuration you can choose to use the page count used by the calibre e-book viewer

Is it actually possible that Count Pages can retrieve the same number of pages displayed in the Viewer header? Currently, it doesn't seem to do so. Perhaps the algorithm has been changed?
I second that the page count for the calibre viewer is not getting the correct number.
JSWolf is offline   Reply With Quote
Old 08-30-2023, 06:05 AM   #1659
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,182
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by JSWolf View Post
I second that the page count for the calibre viewer is not getting the correct number.
thanks!
Comfy.n is online now   Reply With Quote
Old 08-31-2023, 02:54 AM   #1660
kiwidude
Calibre Plugins 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,678
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Certainly calibre changed in the last 12 years to using a different algorithm. Kovid was kind enough to point to the code that is generating that for the ebook viewer, the problem I have at the moment is it requires parsing the book in a different way than the plugin does currently.

I will see if Kovid has any suggestions that may help with implementing his way of processing the ebook to see if I could reuse his actual viewer code. Frankly without his help this will go in the too hard basket at this point in time as my care factor is pretty low when it comes to "accuracy" of page counts. It is impossible to be definitive about because of all the variables - any algorithm is an estimate only and should be used purely to compare the *relative* size of book A vs book B of both using the same algorithm. You are never going to get "the one true value" as no such thing exists. Go lookup paperback vs hardback edition page counts in the printed world which vary based on font sizes, page sizes, layout choices etc - then all the similar variables in the electronic world of device/screen sizes and you will hopefully realise just how ambiguous the term "page" means outside of a printed edition. Right now this plugin may tell me 410 whereas calibre viewer says 388, yet goodreads says the printed paperback edition is 240! It is simply not worth getting too worked up about.

I do agree it is currently misleading to imply this plugin produces the same count as the ebook viewer does in calibre today. If I can't make it produce exactly the same then I will rename things a bit to prevent misconceptions on that. If someone else wants to wrap their head around the relevant calibre code in render_book.py and make a contribution I am happy to take a look at merging it.

FYI how the ebook viewer used to estimate (what this plugin does currently for this option) is just a very crude total characters in the html pages of the book / 1000. Whereas the current ebook viewer code parses the body sections of pages, has various tags it will exclude, strips out all whitespace and divides that by 1000. It also treats every img tag it finds as a page. So unsurprisingly you get quite different counts - with the "old" page count approach generally producing a higher count.

This plugin does already have a number of algorithms based around processing the body section of html and stripping out all tags. However it does so using raw text and regex, rather than XHTML which Kovid's code uses and some extra rules he has in there. For instance my plugin code would strip all img tags completely rather than treating each as a page. I can't make my text based parsing match the counts of XHTML based parsing, hence why this becomes a lot more work...
kiwidude is offline   Reply With Quote
Old 08-31-2023, 03:44 PM   #1661
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 39,737
Karma: 154147706
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by kiwidude View Post
You are never going to get "the one true value" as no such thing exists.
Blasphemer! On a more serious side, that's why I use the same algorithm for all my epub ebooks to make it easy to compare the approximate page counts. I do have one epub that comes in at over 3,000 pages since the Adobe algorithm does not like Base64 inline images.
DNSB is offline   Reply With Quote
Old 08-31-2023, 08:07 PM   #1662
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by DNSB View Post
that's why I use the same algorithm for all my epub ebooks to make it easy to compare the approximate page counts.
I do the same and simply use the ADE algorithm across the entire library to give me consistent approximate page counts for a good estimate of the length of a book.


The idea that there is one perfect number eludes me.
DoctorOhh is offline   Reply With Quote
Old 08-31-2023, 08:08 PM   #1663
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,008
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DoctorOhh View Post
I do the same and simply use the ADE algorithm across the entire library to give me consistent approximate page counts for a good estimate of the length of a book.


The idea that there is one perfect number eludes me.
While ADE page numbers are not perfect, there are none better for eBooks.
JSWolf is offline   Reply With Quote
Old 08-31-2023, 08:24 PM   #1664
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 9,332
Karma: 63265021
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by DNSB View Post
Blasphemer! On a more serious side, that's why I use the same algorithm for all my epub ebooks to make it easy to compare the approximate page counts. I do have one epub that comes in at over 3,000 pages since the Adobe algorithm does not like Base64 inline images.
To pick the one I use (Calibre ebook, 1500 chars/page) I used some books with both eBooks and phyiscal copies (of various sizes). Then I ran the generation with different settings and picked out the one that made page-counts close to the physical copies. I mostly care that the numbers are consistent with each other.

Last edited by ownedbycats; 08-31-2023 at 08:27 PM.
ownedbycats is online now   Reply With Quote
Old 08-31-2023, 08:34 PM   #1665
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,182
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by kiwidude View Post
Certainly calibre changed in the last 12 years to using a different algorithm.
And if it changes again, the plugin would possibly need another code rework, I guess...

Quote:
Originally Posted by kiwidude View Post
Frankly without his help this will go in the too hard basket at this point in time as my care factor is pretty low when it comes to "accuracy" of page counts.
Until recently I used it just for quick comparisons, mainly looking at the book details panel, with the same algorithm (viewer) for all titles. I hadn't noticed that the Viewer header has a different value, currently.

For the purpose I'm aiming - to have an accurate #viewer_pages field to go with the Reading Goal plugin - I think a manually updated column will suffice. Thank you for the detailed update!
Comfy.n is online now   Reply With Quote
Reply

Tags
count, count pages, page count, pages, plugin


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1198 10-05-2024 01:14 AM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[GUI Plugin] Quick Preferences kiwidude Plugins 62 03-16-2024 11:47 PM
[GUI Plugin] Kindle Collections (old) meme Plugins 2070 08-11-2014 12:02 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 10:55 AM.


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