Mobileread
[GUI Plugin] Generate Cover
#1  kiwidude 03-04-2011, 08:12 PM
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:
Special Notes:
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:
Sample Cover Settings:
Version History:
Spoiler Warning below







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

.
Screenshot_1_Configuration.png Screenshot_2_Configuration.png Screenshot_3_Configuration.png Screenshot_4_Configuration.png 
[zip] Generate Cover.zip (179.1 KB, 23974 views)
Reply 

#2  msr 03-04-2011, 09:38 PM
Simply great. You're becoming the plugin king!
Reply 

#3  DoctorOhh 03-05-2011, 03:27 AM
Thanks for this plugin.

The only thing I noticed was not being able to see all 3 numbers in the cover width and height dimensions (see attached).

This might be due to using increased font sizes but this is the only area of calibre that limits me in this way.
cover_plugin.jpg 
Reply 

#4  kiwidude 03-05-2011, 05:41 AM
Oops, thats a pretty ugly screen layout dwanthy! I've pushed up a new version now. I had been through a lot of variations of layout as this was developed and I thought of new customisations, and I'd left some rather crude sizing code in there. The new version should hopefully address your issues.

Let me know how you get on - now I've figured out what to do I'll make sure I don't make the same mistake in my other plugins again.
Reply 

#5  DoctorOhh 03-05-2011, 07:06 AM
Quote kiwidude
Let me know how you get on - now I've figured out what to do I'll make sure I don't make the same mistake in my other plugins again.
Looks great!
Reply 

#6  GRiker 03-05-2011, 11:47 AM
Attempting to customize the plugin yields the following error:

Code
Traceback (most recent call last): File "/Users/griker/Documents/calibredev/calibre/src/calibre/gui2/preferences/plugins.py", line 260, in customize_plugin self.modify_plugin(op='customize') File "/Users/griker/Documents/calibredev/calibre/src/calibre/gui2/preferences/plugins.py", line 319, in modify_plugin if not plugin.is_customizable(): File "/Users/griker/Documents/calibredev/calibre/src/calibre/customize/__init__.py", line 248, in is_customizable self.customization_help() File "<string>", line 59, in customization_help
AttributeError: 'GenerateCoverBase' object has no attribute 'customization_help'
But other than that, this is a very nice plugin.

G
Reply 

#7  kiwidude 03-05-2011, 12:09 PM
I've done so many plugins now that have customisation via Preferences I clearly screwed up the situation for a plugin that doesn't and didn't rip out enough code

New version attached to the first post.
Reply 

#8  Perkin 03-05-2011, 12:11 PM
Thanks kiwidude.
Reply 

#9  Perkin 03-05-2011, 12:21 PM
A couple of tweaks...
Can you do it so you can select the Font colour
And allow the image to be the whole background, I've got some nice leather look covers and would like the whole cover to be that, not just an inset image.
Reply 

#10  kiwidude 03-05-2011, 03:54 PM
Quote Perkin
A couple of tweaks...
Can you do it so you can select the Font colour
And allow the image to be the whole background, I've got some nice leather look covers and would like the whole cover to be that, not just an inset image.
Both were on my list to investigate for a future version but I figured I would wait to see if anyone asked for them. Then you ask in the first 24 hours... lol

There is a bit of a dependency between them, since unless you have a light background you are going to want the text color changed. However I haven't figured out how to change the color since I can't find any code in Calibre related to this in the Magick libraries. I suspect it is something to do with a DrawingWand but it is yet another library I have no knowledge of. I'll ask in the developer forum here if Kovid doesn't spot this post and reply here.
Reply 

  Next »  Last »  (1/62)
Today's Posts | Search this Thread | Login | Register