View Single Post
Old 03-04-2011, 07:12 PM   #1
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,246
Karma: 1445996
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
[GUI Plugin] Generate Cover

Users will often have books in their collection for which there is no official cover available to download, such as short fiction and articles. Calibre includes the ability to generate a cover for you from the book metadata. However currently the only control over its appearance it offers is a tweak for the font.

This plugin offers an enhanced alternative that allows you to select from your own choice of cover images and a wide range of layout/appearance options.

Main Features of v1.5.21:
  • Add/remove your own images to a list to choose from when you generate
  • Option to use the existing book cover as an embedded image
  • Control which metadata to display and where it is located on the cover
  • Option to swap author name for users who store it in Calibre as LN, FN
  • Fine tune many aspects of cover appearance such as fonts, borders, colors and margins
  • Save your customised settings under a name to quickly recall multiple different appearances
  • Export your settings for sharing and import settings from other users
  • Option to use an image as a background rather than a content item
  • Option to add custom text to a cover, using Calibre's template language to place your choice of additional data on the cover
  • Option to auto-size text to fit on a single line for long text

Special Notes:
  • Requires Calibre v0.9.5 or later.

Installation Steps:
  1. Download the attached zip file and install the plugin/add to context menu or toolbar/restart Calibre as described in the Introduction to plugins thread.
  2. Select the book(s) you want to generate a cover for, and select the Generate Cover menu option or toolbar button you have configured in step 1. The configuration dialog as per the screenshot will open allowing you to import images and alter appearance.

Paypal Donations:
  • If you find this or any of my other plugins useful please feel free to show your appreciation. I have spent many hundreds of unpaid hours in their development and support so any encouragement for me to continue is appreciated!

Sample Cover Settings:
Version History:

Version 1.5.21 - 31 July 2016
Fix a regression in the previous release that broke integration with the FanFicFare plugin

Version 1.5.20 - 29 July 2016
Fix incorrect handling of book with multiple authors (extra spaces inserted around &)
Also use the correct calibre APIs to read the cover from the database.

Version 1.5.19 - 21 May 2016
Fix inability to use first font in the list of fonts for rendering text

Version 1.5.18 - 20 May 2016
Compatibility for calibre 2.57+

Version 1.5.16 - 11 Oct 2014
Compatibility for calibre 2.4+

Version 1.5.15 - 15 Jul 2014
Compatibility for the upcoming calibre 2.0

Version 1.5.14 - 29 Sep 2013
Fix for the user typing \n or or <br> or <br/> as part of the author to control split across multiple lines

Version 1.5.13 - 24 Sep 2013
Support the user typing \n or or <br> or <br/> as part of the title or series to control split across multiple lines
Add a checkbox option to allow scaling up the cover image to fit the available area if it is too small.

Version 1.5.12 - 03 May 2013
Fix for change made to calibre API in 0.9.29

Version 1.5.11 - 17 Mar 2012
Fix bug of import saved cover settings not working

Version 1.5.10 - 06 Mar 2013
Re-release of 1.5.9 due to problem with zip file

Version 1.5.9 - 06 Mar 2013
Add a "Metadata" section to the "Content" tab allowing the user to override title/author/series for one-off covers
Add ability to configure a custom column (or tags column) to contain a value any time a cover is generated for a book

Version 1.5.8 - 09 Dec 2012
Automatically "correct" any corrupted json files when users upgrade to this version
Check for corruption every time Generate Cover is opened. If found, show error dialog and autofix.
Prevent plugin being used in Device View or on Device View context menu

Version 1.5.7 - 14 Nov 2012
Fix bug in stretch cover/resize option not finding full path to image.

Version 1.5.6 - 03 Nov 2012
Add support for calibre 0.9.5 which changed how Fonts are loaded.

Version 1.5.5 - 14 Aug 2012
No longer use a calibre ImageView to preview cover as it has right-click menu and drag/drop not relevant to this plugin
Add protection against failed upgrades of the seriesText field.

Version 1.5.4 - 01 Jun 2012
Make the series text an option so foreign language users can change it
No longer respect the calibre preferences Roman Numerals setting - series index will always be displayed numerically.

Version 1.5.3 - 31 May 2012
Ensure paths to images used by this plugin are stored as relative paths for portability
Change the calibre library image to appear as {Default Image} in the images list
Reorder the images list so {Default Image} and {Current Cover} appear at the top
Allow renaming images changing only their casing

Version 1.5.2 - 20 May 2012
Add a 'Resize cover dimensions to match background image' suboption for if you have stretch image to use as cover background enabled.

Version 1.5.1 - 03 May 2012
Fix issue of version number not incremented for 1.5.0

Version 1.5.0 - 02 May 2012
Fix bug occurring with selection changes and corrupted multiple cover settings
Set maximum font size to 999 instead of 99
Add a separate right margin option, rather than using left margin for both
On the Fonts tab allow specifying the alignment for each text item of left, centre, right rather than always centre
Expose API methods to allow more conveniently calling from other plugins
Add export and import capability for sharing settings/images with other users
Add an 'Autosave setting' option to Settings tab. When checked, any changes to settings are always saved (except when Cancel pressed)
When clicking OK (or Import or Export) prompt user to save settings if changed before continuing.
If font assigned to a setting (whether existing or imported) is not found, use the default font rather than erroring
If user renames image just by stripping extension, treat this same as if user cancelled rename operation
Allow importing of multiple images at once.
Allow importing of multiple setting zips at once.

Version 1.4.0 - 11 Sep 2011
Upgrade to support the centralised keyboard shortcut management in Calibre

Version 1.3.8 - 03 Jul 2011
Replace the deprecated composite_formatter with SafeFormat()

Version 1.3.7 - 04 Jun 2011
Use a progress dialog while generating covers

Version 1.3.6 - 03 Jun 2011
Bug fix for fonts being set to "Default" resulting in null in config file causing an error

Version 1.3.5 - 01 Jun 2011
Add a special token to the list of images representing the current cover for the book to allow embedding
Abort autosize logic with replaced text when text is too large to fit so plugin does not lockup

Version 1.3.4 - 27 Apr 2011
Allow custom text field to be formatted using Calibre template engine
Change custom text field so it is a multiline field for more space and complex content

Version 1.3.3 - 23 Apr 2011
Ensure that margins are set to zero if set to too high a value to prevent crash

Version 1.3.2 - 09 Apr 2011
Support skinning of icons by putting them in a plugin name subfolder of local resources/images

Version 1.3.1 - 04 Apr 2011
Fix error for users migrating from particular previous versions

Version 1.3 - 03 Apr 2011
Rewritten for new plugin infrastructure in Calibre 0.7.53

Version 1.2.1 - 26 Mar 2011
Ensure version number put in config file for first-time user

Version 1.2 - 26 Mar 2011
Support freeform text added to cover.
Add option to autosize text to fit on one line.
Add a timer to ensure GUI does not redraw preview as every UI change made.

Version 1.1 - 16 Mar 2011
Redesign GUI.
Support drag/drop images.
Support text colors.
Support image as background.
Support linking single font.
Support named saved settings.
Copy image files to resources directory.
Support renaming image files.

Version 1.0.2 - 05 Mar 2011
Fix error appearing if trying to customize through preferences

Version 1.0.1 - 05 Mar 2011
Remove fixed widths for users with large fonts

Version 1.0 - 05 Mar 2011
Initial release of Generate Cover plugin

Attached Thumbnails
Click image for larger version

Name:	Screenshot_1_Configuration.png
Views:	5421
Size:	175.6 KB
ID:	85981   Click image for larger version

Name:	Screenshot_2_Configuration.png
Views:	4601
Size:	117.0 KB
ID:	85982   Click image for larger version

Name:	Screenshot_3_Configuration.png
Views:	4644
Size:	240.5 KB
ID:	85983   Click image for larger version

Name:	Screenshot_4_Configuration.png
Views:	4533
Size:	189.4 KB
ID:	85984  
Attached Files
File Type: zip Generate (179.1 KB, 22043 views)

Last edited by kovidgoyal; 07-30-2016 at 07:47 PM. Reason: v1.5.21 released - date corrected
kiwidude is offline   Reply With Quote