Welcome, Guest
Python Scripts for ComicRack

TOPIC: Extract only 1st page in archive (cover page)

Re:Extract only 1st page in archive (cover page) 8 years 8 months ago #3107

  • wadegiles
  • wadegiles's Avatar
  • Offline
  • Gold Boarder
  • Posts: 248
  • Thank you received: 3
  • Karma: 20
Assuming you want to use the file name of each eComic to name the cover images and save these cover images in the same folder as each eComic, you'll need to follow these steps to produce that behavior in the script.

Delete this entire line and every line after it in the file ExtractFirstPage.py:

folderDialog = FolderBrowserDialog()

Add the following line indented once <TAB>:

for book in books:

Add the following lines and indent each line twice <TAB><TAB>:

pageNameString = "Cover"

destinationFilePath = book.FileDirectory + '\\' + book.FileName + ' Page' + pageNameString + '.jpg'

pageImage = ComicRack.App.GetComicPage(book, book.FrontCoverPageIndex)

pageImage.Save(destinationFilePath, ImageFormat.Jpeg)


Save the file and start ComicRack.
Last Edit: 8 years 8 months ago by wadegiles.
The administrator has disabled public write access.
The following user(s) said Thank You: oraclexview

Re:Extract only 1st page in archive (cover page) 8 years 8 months ago #3108

  • Tension113
  • Tension113's Avatar
  • Offline
  • Senior Boarder
  • Posts: 49
  • Thank you received: 2
  • Karma: 0
Perfect.. Thank you for the help..

Between this and your file renaming script, I'm a very happy guy.. I'm still new so I have yet to see what other scripts are available, but as of right now I can finally do things I've wanted to do for a long time now.. :cheer:
The administrator has disabled public write access.

Re:Extract only 1st page in archive (cover page) 7 years 9 months ago #5143

  • Flinx
  • Flinx's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Hi
in version
ComicRack 0.9.113
the script will not appear in the settings
and does not work

Update
the script works with 0.9.115
Last Edit: 7 years 9 months ago by Flinx.
The administrator has disabled public write access.

Re:Extract only 1st page in archive (cover page) 6 years 10 months ago #11459

  • Flaser
  • Flaser's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 3
  • Karma: 2
Thank you for your excellent plugin, it saved me the headache of how to select the cover file from within a zipped archive.

I've also confirmed that this plugin works in conjunction with this other plugin:
comicrack.cyolito.com/user-forum/13-scri...move-scanner-credits

So unlike what its name suggest, it's intelligent enough to grab the cover itself, rather than just the 1st file.
The administrator has disabled public write access.

Re:Extract only 1st page in archive (cover page) 6 years 10 months ago #11464

  • Infina
  • Infina's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Does it work with issues that have variant covers (more than 1 file)?
The administrator has disabled public write access.

Re:Extract only 1st page in archive (cover page) 6 years 10 months ago #11466

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
Did I hear XBMC...?!?!?! :lol:

Which addon/script you use to browse comics?
The administrator has disabled public write access.

Re:Extract only 1st page in archive (cover page) 6 years 5 months ago #14859

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 232
Updated to crplugin format with package information and new icon

File Attachment:

File Name: ExtractFir...crplugin
File Size:4 KB


Now Playing: The ComicRack Manual (Online)

See my new comics & gadgets on: Tumblr!
The administrator has disabled public write access.
The following user(s) said Thank You: oraclexview

Re:Extract only 1st page in archive (cover page) 3 years 6 months ago #39210

  • Phytoplasm
  • Phytoplasm's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Hi guys,

very useful. I need a similar script with 'copy page function': always starting with a selection of thumbails but in this case extract from .cbr archives each first files with their original extension and quality (like open a comic in ComicRack, right click on first page and 'copy page' option).

I tried 'Comic Utility Belt' which is exactly what I need and is good too, but seem it has a limit of 200 files and sometimes I've got a error message during extraction of many files. So with a large library and many subfolders is not friendly to use at the moment.

Thanks for some suggestions.



PS: or a batch extraction script for .rar archive, I've only .cbr files
The administrator has disabled public write access.

Extract only 1st page in archive (cover page) 1 year 5 months ago #45586

  • oraclexview
  • oraclexview's Avatar
  • Offline
  • Moderator
  • aka SoundWave
  • Posts: 906
  • Thank you received: 182
  • Karma: 37
I've been using Kodi (formerly XBMC) a lot lately on my NAS system, and was looking into how i can generate proper cover page thumbnails for my CBR/CBZ files that I view in Kodi.

In the Kodi application, you can go into the system settings and have it auto-generate thumbnails for each comic file. As long as the image files inside of the CBR/CBZ archive files are in the top level of the archive file, and the first image file is the cover, then Kodi will auto-generate a thumbnail for the cover just fine. However, if the image files inside of the CBR/CBZ archive file are NOT in the top level of the archive file (nested in a subfolder for example) and/or the the first image file isn't the cover, then Kodi will auto-generate a thumbnail that's either four pages in one image, or a thumbnail which is not the actual cover page.

To fix this issue, I updated the script that wadegiles wrote to create a "tbn" file of the front cover that is the same name in the same directory as the comic file. When Kodi sees this file, it will use this cover image instead of the auto-generated image it creates. I also updated the icon that 600WPMPO created by making this icon a bit smaller and placing it on top of the Kodi icon.

Here is this version of the plugin script:
Extract First Cover for Kodi

File Attachment:

File Name: ExtractFir...crplugin
File Size:6 KB





Hopefully some of you will get usage out of this. Special thanks goes out to both wadegiles & 600WPMPO for an existing plugin that didn't take much tweaking at all.
Last Edit: 1 year 4 months ago by oraclexview.
The administrator has disabled public write access.
The following user(s) said Thank You: fertones

Extract only 1st page in archive (cover page) 1 year 4 months ago #45736

  • fertones
  • fertones's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
Thanks oraclexview, but why not in jpg and select the path would be great
Last Edit: 1 year 4 months ago by fertones.
The administrator has disabled public write access.
Time to create page: 0.602 seconds

Who's Online

We have 269 guests and 5 members online