Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-21-2018, 03:13 PM   #1186
rpgmaker
Connoisseur
rpgmaker began at the beginning.
 
Posts: 83
Karma: 10
Join Date: Oct 2014
Device: Kindle Paperwhite 2
Quote:
Originally Posted by davidfor View Post
Using the Scramble ePub plugin will produce a book that can be posted, and should work with the Page Count. Otherwise, upload them somewhere and PM me the link.
Here is a scrambled copy of the book. I actually had split the html file before in order to see if that would make the issue go away (originally it was one huge html file for the entire book) but the pages were still counted the same way so the issue is still there. I think the problem is the way that the styles are applied in the book. Huge mess.
Attached Files
File Type: azw3 Guide Book - Author.azw3 (5.77 MB, 52 views)
rpgmaker is offline   Reply With Quote
Old 07-22-2018, 04:45 AM   #1187
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 15,510
Karma: 25810738
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
Quote:
Originally Posted by rpgmaker View Post
I found one book that this plugin is giving 4.9k pages when in reality the paperback has 608. The previous edition of that same ebook from the same publisher has 982 pages according to the Count Pages plugin. I PM'ed kiwi with the details.
Quote:
Originally Posted by rpgmaker View Post
Here is a scrambled copy of the book. I actually had split the html file before in order to see if that would make the issue go away (originally it was one huge html file for the entire book) but the pages were still counted the same way so the issue is still there. I think the problem is the way that the styles are applied in the book. Huge mess.
I have had a look at this, and it is working as designed. And the problem is the messy code in the book.

The APNX page calculation does the page count in two ways. Then it takes the maximum of the two.

The first way assumes a line is 70 characters long and a page has 31 lines. The plugin counts the paragraphs and text in each paragraph ignoring tags within the paragraph. This works out to 912 pages.

The other method, called "fast count", is to simply divide the total length of the HTML code by 2400. This works out to be 4937 pages. This is high because the paragraph tags have long styles and there are lots of spans with long styles wrapping only a few characters.

The plugin uses the maximum of these calculations. There is a comment in the code that the maximum is used in case it is a "really weird document" and that the first method underestimates the page count.

You mention that a previous version of the book gave a lower page count. That should be because the code in it was cleaner and the first method was probably the higher value.
davidfor is offline   Reply With Quote
Advert
Old 07-22-2018, 01:38 PM   #1188
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 7,807
Karma: 9065382
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
IIRC, the second method was designed with Mobi in mind, which somewhat alleviated the potential issue of really messy code . With more complex formats, it's probably less useful & accurate.
NiLuJe is offline   Reply With Quote
Old 07-22-2018, 11:34 PM   #1189
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 15,510
Karma: 25810738
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
Quote:
Originally Posted by NiLuJe View Post
IIRC, the second method was designed with Mobi in mind, which somewhat alleviated the potential issue of really messy code . With more complex formats, it's probably less useful & accurate.
The code is probably pre-azw3, so that might be right. I'll look at adding a format check on that bit.
davidfor is offline   Reply With Quote
Old 07-23-2018, 01:19 AM   #1190
rpgmaker
Connoisseur
rpgmaker began at the beginning.
 
Posts: 83
Karma: 10
Join Date: Oct 2014
Device: Kindle Paperwhite 2
Quote:
Originally Posted by davidfor View Post
I have had a look at this, and it is working as designed. And the problem is the messy code in the book.

The APNX page calculation does the page count in two ways. Then it takes the maximum of the two.

The first way assumes a line is 70 characters long and a page has 31 lines. The plugin counts the paragraphs and text in each paragraph ignoring tags within the paragraph. This works out to 912 pages.

The other method, called "fast count", is to simply divide the total length of the HTML code by 2400. This works out to be 4937 pages. This is high because the paragraph tags have long styles and there are lots of spans with long styles wrapping only a few characters.

The plugin uses the maximum of these calculations. There is a comment in the code that the maximum is used in case it is a "really weird document" and that the first method underestimates the page count.

You mention that a previous version of the book gave a lower page count. That should be because the code in it was cleaner and the first method was probably the higher value.
I figured. Thanks for looking into it. It's the only book that has ever given me any issues with this plugin so I'm just gonna let it be.
rpgmaker is offline   Reply With Quote
Advert
Old 08-06-2018, 07:31 AM   #1191
Iceybones
Junior Member
Iceybones began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle PW3
My books have verified goodreads Ids and when I go through the goodreads plugin I can see that goodreads does have a page count listed for all my books but 9 times out of 10 the Count Pages plugin comes back "FAILED TO GET PAGE COUNT FROM WEBSITE". I can't figure out why. Any ideas? If I keep rerunning the search it will pick up a few more here and there but still very rare for it to find one.

Last edited by Iceybones; 08-06-2018 at 07:33 AM.
Iceybones is offline   Reply With Quote
Old 08-06-2018, 08:05 AM   #1192
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 15,510
Karma: 25810738
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
Quote:
Originally Posted by Iceybones View Post
My books have verified goodreads Ids and when I go through the goodreads plugin I can see that goodreads does have a page count listed for all my books but 9 times out of 10 the Count Pages plugin comes back "FAILED TO GET PAGE COUNT FROM WEBSITE". I can't figure out why. Any ideas? If I keep rerunning the search it will pick up a few more here and there but still very rare for it to find one.
Are there any more details? There should be more than that in the log and it hopefully includes an error message about why the books failed.
davidfor is offline   Reply With Quote
Old 08-06-2018, 08:45 AM   #1193
Iceybones
Junior Member
Iceybones began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle PW3
Hey Davidfor. Thanks for the quick reply. Looks like the reason is "Failed to make details query:...". I uninstalled it and reinstalled it a few times and just tried it again and it worked like a charm for the first 20 books, now it's back to not working/only successful on 1 out of every 50 or so. Perhaps I'm hitting a reCaptcha?

Last edited by Iceybones; 08-06-2018 at 09:08 AM.
Iceybones is offline   Reply With Quote
Old 08-06-2018, 09:44 AM   #1194
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: 52,418
Karma: 47532469
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Just a quick note. The page count for eBooks on GoodReads is wrong. The staff refuse to accept the correct page number for eBooks and use some version pBook page numbers and that is 100% wrong.
JSWolf is offline   Reply With Quote
Old 08-06-2018, 10:27 AM   #1195
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 15,510
Karma: 25810738
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
Quote:
Originally Posted by Iceybones View Post
Hey Davidfor. Thanks for the quick reply. Looks like the reason is "Failed to make details query:...". I uninstalled it and reinstalled it a few times and just tried it again and it worked like a charm for the first 20 books, now it's back to not working/only successful on 1 out of every 50 or so. Perhaps I'm hitting a reCaptcha?
Goodreads does do some speed limiting. Doing a lot of queries in a short period of time can get you put on their black list for a while. This is the most likely reason. I have reproduced it here by running two lots of 75 books one after another. The only real solution is to not do as many queries, or maybe add a delay. But, the error message is useless, so I might do some testing to see what it really is.
davidfor is offline   Reply With Quote
Old 08-06-2018, 10:31 AM   #1196
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 15,510
Karma: 25810738
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
Quote:
Originally Posted by JSWolf View Post
Just a quick note. The page count for eBooks on GoodReads is wrong. The staff refuse to accept the correct page number for eBooks and use some version pBook page numbers and that is 100% wrong.
Looking at some of my books, Goodreads has a page count for each edition it has. So, yes, the do have the page count for a paper book, but they also have counts for other paper books and ebooks.
davidfor is offline   Reply With Quote
Old 08-06-2018, 10:44 AM   #1197
Iceybones
Junior Member
Iceybones began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle PW3
davidfor: Ok that's understandable. Thanks. I'm having it calculate all my books right now and putting the page count into a separate column, just so I get a relative idea. Then I'll just have to do the goodreads column in small batches.
Iceybones is offline   Reply With Quote
Old 09-03-2018, 04:37 PM   #1198
kjdavies
Junior Member
kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.
 
Posts: 7
Karma: 53170
Join Date: Jun 2013
Device: Sony PRS-600
I'm running calibre 3.28 (I'll update soon) and Count Pages plugin 1.8.2 on a Windows 10, 64-bit. It appears Count Pages copies the book files to a temporary directory on the system drive. Is it possible to not do this? Can the files be examined in-place?

I'm working with a large number of biggish files (comic book collection, 100MB files aren't uncommon) and the solid state system drive isn't that big. Discovering the 70GB free space was suddenly gone was a bit of an unpleasant shock...
kjdavies is offline   Reply With Quote
Old 09-03-2018, 08:07 PM   #1199
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 11,337
Karma: 10578436
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@kjdavies - those temporary files should have been deleted as it counted each book.

By default calibre uses the default location for temporary files (e.g. on it's Windows C:\Users\<users>\AppData\Local\Temp), and it uses it extensively, e.g. when adding and converting books. It's pretty good at cleaning up, but remnants can get left behind that normal 'system cleanup' processes take of.

You can give calibre a dedicated folder for its temporaries on another drive via the CALIBRE_TEMP_DIR environment variable, see User Manual: Environment variables

If you give calibre a dedicated location for its temporaries you'll have to make provision for any additional cleanup.

Curious - what format are the comics? I only count words and I never run Count Pages against CBZ or CBR (or audio/video formats etc). Maybe the plugin needs an Exclude Formats setting.

BR
BetterRed is online now   Reply With Quote
Old 09-03-2018, 08:41 PM   #1200
kjdavies
Junior Member
kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.
 
Posts: 7
Karma: 53170
Join Date: Jun 2013
Device: Sony PRS-600
Quote:
Originally Posted by BetterRed View Post
@kjdavies - those temporary files should have been deleted as it counted each book.

By default calibre uses the default location for temporary files (e.g. on it's Windows C:\Users\<users>\AppData\Local\Temp), and it uses it extensively, e.g. when adding and converting books. It's pretty good at cleaning up, but remnants can get left behind that normal 'system cleanup' processes take of.

You can give calibre a dedicated folder for its temporaries on another drive via the CALIBRE_TEMP_DIR environment variable, see User Manual: Environment variables

If you give calibre a dedicated location for its temporaries you'll have to make provision for any additional cleanup.

Curious - what format are the comics? I only count words and I never run Count Pages against CBZ or CBR (or audio/video formats etc). Maybe the plugin needs an Exclude Formats setting.

BR
Very informative, thank you.

In this case calibre did clean up after itself, but not until I'd discovered it filled the system drive. I closed calibre and the space was recovered.

I've set CALIBRE_TEMP_DIR as a system variable, so that should work after restarting.

I'm counting pages in (in this case) CBZ files, but I do have CBR (that I usually convert to CBZ). Page count is equal to the number of images.

Overall I'm happy with how this plugin works, and would prefer that CBZ and CBR continue to be supported. I just noticed that it ate my system drive.

I've also noticed that queuing the files takes many times longer (not measured, but observed) than the page count. If it could read in place it would finish almost immediately. This obviously might not be true of other formats such as PDF and EPUB.
kjdavies is offline   Reply With Quote
Reply

Tags
count pages, page count

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 906 11-04-2018 01:38 PM
[GUI Plugin] Open With kiwidude Plugins 332 08-31-2018 09:54 AM
[GUI Plugin] Quick Preferences kiwidude Plugins 33 06-20-2018 04:00 AM
[GUI Plugin] Kindle Collections (old) meme Plugins 2070 08-11-2014 01:02 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 01:27 PM


All times are GMT -4. The time now is 06:36 AM.


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