Welcome, Guest
Python Scripts for ComicRack
  • Page:
  • 1
  • 2

TOPIC: Remove scanner page at end of books

Remove scanner page at end of books 2 years 5 months ago #42190

  • Herjar
  • Herjar's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
I made a script that checks for scanner pages and sets them to deleted. There are some setup variables at the top that can be changed. It has two ways to check for the pages. You can choose to use one or both of them.
  1. Check for filenames of pages starting with 'z'
  2. Check resolution ratio for last page in book

The first method works often with new books as scanners often start the filename with 'z' now.
For this method to work you need to set the path to winrar at the top of the script.

The second method is used if it does not start with 'z'. I noticed that scanners often use a double page at the end. I'm using the "autorotate for double pages" option and it always annoys me when it rotates at the last page just to show me the scanner. This method checks the x/y resolution ratio on the last page and sets it to deleted if it's larger than 0.95 (this can be changed at top of script).

So the script will not remove scanner pages if they do not start with 'z' or if they use the same aspect ratio as a normal comic page. But it fixes the annoying rotation on Android.

So far it is working great for me and I almost never see any scanner pages any more.

It's my first attempt to make a script for ComicRack so just suggest improvements if you have any.

Couldn't attach the file for some reason, but here it is:
drive.google.com/file/d/0B7KiFn1VugfARDl...bkU/view?usp=sharing
Last Edit: 2 years 4 months ago by Herjar. Reason: Updated script
The administrator has disabled public write access.

Remove scanner page at end of books 2 years 5 months ago #42203

  • Shinrai
  • Shinrai's Avatar
  • Offline
  • Platinum Boarder
  • With great power comes great W/T.
  • Posts: 885
  • Thank you received: 81
  • Karma: 33
What if you have a book which ACTUALLY ends on a double page?
The administrator has disabled public write access.

Remove scanner page at end of books 2 years 5 months ago #42208

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 760
  • Thank you received: 247
  • Karma: 55
I adapted various move page scripts. So my process is:

1) View all new books in a thumbnail view.
2) Export all to CBZ alowing the default page names (ie P0001 etc)
3) Use a 'Move Last Page to First Script' which changes the thumbnail to the last page.
4) For all with a scanner page > Use a 'Delete First Page and move to Back' Script.
5) For all with no Scanner page > Use a 'Move back' Script.
6) Re-export all books.

Missing step 2 can lead to the wrong page being moved to the thumbnail position.

If anyone knows how to call a Export Books Preset from within a script I could make this easier.

Here is the package I made from Stonepaw's original page moving scripts if you want to try them.

File Attachment:

File Name: ScannerThumb.crplugin
File Size:1 KB


There is a readme file contained inside which reads thus:
Scanner Thumbnail Scripts 

The three scripts each perform operations on books with standard page names (ie P0001, P0002 ...).

ST Last to First: 
Moves the last page into the first position and makes it the cover in order to display as the thumbnail.

ST Delete:
Moves the first page to the end of the book and marks it as deleted marking the new first page as the front cover.

ST Move Back:
Moves the first page back to the last page without deleting, removes the front cover arttibute and marks the new front page as the front cover.


To use these scripts:

1) View all new books in a thumbnail view.
2) Export all to CBZ to ensure default page names.
3) Use 'ST Last to First'
4) Select all books with a scanner page showing as the thumbnail and use 'ST Delete'
5) Select all books with a normal page showing as the thumbnail and use 'ST Move Back'
6) Export all books again to ensure page deletions and remarking of pages.
Last Edit: 2 years 5 months ago by jkthemac.
The administrator has disabled public write access.

Remove scanner page at end of books 2 years 5 months ago #42209

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 760
  • Thank you received: 247
  • Karma: 55
Shinrai wrote:
What if you have a book which ACTUALLY ends on a double page?
It is unlikely to also begin with a 'z' which is one way to detect them.
Last Edit: 2 years 5 months ago by jkthemac.
The administrator has disabled public write access.

Remove scanner page at end of books 2 years 5 months ago #42218

  • Herjar
  • Herjar's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
jkthemac wrote:
I adapted various move page scripts. So my process is:

1) View all new books in a thumbnail view.
2) Export all to CBZ alowing the default page names (ie P0001 etc)
3) Use a 'Move Last Page to First Script' which changes the thumbnail to the last page.
4) For all with a scanner page > Use a 'Delete First Page and move to Back' Script.
5) For all with no Scanner page > Use a 'Move back' Script.
6) Re-export all books.

Do you need to export? I prefer to not change my original files if I can.
The administrator has disabled public write access.

Remove scanner page at end of books 2 years 5 months ago #42219

  • Herjar
  • Herjar's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
jkthemac wrote:
Shinrai wrote:
What if you have a book which ACTUALLY ends on a double page?
It is unlikely to also begin with a 'z' which is one way to detect them.

What do you mean by starts with z?

And yes if the book actually ends on a double page it will be marked as deleted. Not actually deleted of course. So if you notice something missing while reading you can easily change it back to a story page.
But don't use it for e.g. "Private Eye" where every page is "widescreen".
The administrator has disabled public write access.

Remove scanner page at end of books 2 years 5 months ago #42223

  • Targg
  • Targg's Avatar
  • Offline
  • Senior Boarder
  • Posts: 40
  • Thank you received: 6
  • Karma: 1
Or you could just leave them in. With 5TB hard drives selling for $125, the usual complaint of "each MB counts" is silly.
The administrator has disabled public write access.

Remove scanner page at end of books 2 years 5 months ago #42227

  • Herjar
  • Herjar's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
I do leave them in. They just don't show up when I read. HD space is not an issue.
The administrator has disabled public write access.

Remove scanner page at end of books 2 years 5 months ago #42232

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 760
  • Thank you received: 247
  • Karma: 55
Herjar wrote:
Do you need to export? I prefer to not change my original files if I can.
If you don't export the file remains inside the cbz.

For my method it is actively removing the file and making sure the first page is set as Front Cover within the file.

Also, my method relies on the individual files inside the CBZ already being in the standarised format. Nealy all CBZs & CBRs in the wild are just any old rar and zip files. These are less compatible with CR.

Herjar wrote:
What do you mean by starts with z?

Nowadays nearly all scanner pages have a filename beginning with z for easy extraction.
Last Edit: 2 years 5 months ago by jkthemac.
The administrator has disabled public write access.

Remove scanner page at end of books 2 years 5 months ago #42233

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 760
  • Thank you received: 247
  • Karma: 55
Targg wrote:
Or you could just leave them in. With 5TB hard drives selling for $125, the usual complaint of "each MB counts" is silly.

I just find them annoying and as I often tinker with the file and always use Export Book then I may as well get rid of them.

Deleted pages still show up on my iPad and I dont always use CRiOS.
Last Edit: 2 years 5 months ago by jkthemac.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.282 seconds

Who's Online

We have 200 guests and 2 members online