Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-29-2021, 05:28 AM   #46
m1d1
Enthusiast
m1d1 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Aug 2015
Location: Stuttgart - Germany
Device: Pocketbook Touch HD
Thanks for reporting.
To which size did you set Prettify Cover? (Default is 758x1024)
I want to reproduce the error.
m1d1 is offline   Reply With Quote
Old 12-29-2021, 06:16 PM   #47
m1d1
Enthusiast
m1d1 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Aug 2015
Location: Stuttgart - Germany
Device: Pocketbook Touch HD
Here is version 1.5.3 please test.
Install plug-in from file in calibre.

Quote:
Originally Posted by FrederikNJS View Post
I tried using this plugin, but hit an annoying TypeError. It would seem that in both line 347 and 423 in the "action.py" file, the "x" and "y" variables can be floats (or maybe they just are by default?)... Anyway, here's the stack trace:

Code:
calibre, version 5.34.0
ERROR: Unhandled exception: <b>TypeError</b>:arguments did not match any overloaded call:
  QRect(): too many arguments
  QRect(int, int, int, int): argument 1 has unexpected type 'float'
  QRect(QPoint, QPoint): argument 1 has unexpected type 'float'
  QRect(QPoint, QSize): argument 1 has unexpected type 'float'
  QRect(QRect): argument 1 has unexpected type 'float'

calibre 5.34  embedded-python: False is64bit: True
Linux-5.15.10-zen1-1-zen-x86_64-with-glibc2.33 Linux ('64bit', 'ELF')
('Linux', '5.15.10-zen1-1-zen', '#1 ZEN SMP PREEMPT Fri, 17 Dec 2021 11:17:39 +0000')
Python 3.10.1
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 46, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 46, 0) && Count Pages (1, 11, 1) && Goodreads Sync (1, 15, 1) && KFX metadata reader (from KFX Input) (1, 46, 0) && KFX Input (1, 46, 0) && KePub Input (3, 4, 3) && KePub Metadata Reader (3, 4, 3) && KePub Metadata Writer (3, 4, 3) && KePub Output (3, 5, 3) && Kindle hi-res covers (0, 5, 0) && Kobo Books (1, 8, 3) && Kobo Utilities (2, 14, 1) && KoboTouchExtended (3, 5, 4) && Obok DeDRM (7, 2, 1) && Prettify Cover (1, 5, 0)
Traceback (most recent call last):
  File "calibre_plugins.prettify_cover.dialogs", line 132, in showEvent
    self.generate_thumbs()
  File "calibre_plugins.prettify_cover.dialogs", line 309, in generate_thumbs
    tmp = self.ia.prettify_cover_for_book(self.cover, self.nwidth,
  File "calibre_plugins.prettify_cover.action", line 347, in prettify_cover_for_book
    target_rect = QRect(x, int(y), int(new_width), int(new_height))
TypeError: arguments did not match any overloaded call:
  QRect(): too many arguments
  QRect(int, int, int, int): argument 1 has unexpected type 'float'
  QRect(QPoint, QPoint): argument 1 has unexpected type 'float'
  QRect(QPoint, QSize): argument 1 has unexpected type 'float'
  QRect(QRect): argument 1 has unexpected type 'float'
I decided to try tinkering with it, and simply wrapped the "x" and the "y" parameter in "int()", so line 347 for example changes from:
Code:
target_rect = QRect(x, y, new_width, new_height)
to:
Code:
target_rect = QRect(int(x), int(y), new_width, new_height)
This seems to have resolved my issue, and everything just works now.

This would of course be nice if it was properly resolved directly (and correctly) in the plugin, but for now I have been able to hack-fix it with the typecast.
Attached Files
File Type: zip Prettify Cover.zip (197.1 KB, 151 views)
m1d1 is offline   Reply With Quote
Advert
Old 03-17-2022, 02:54 PM   #48
LWTBP
Member
LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.
 
LWTBP's Avatar
 
Posts: 16
Karma: 222088
Join Date: Aug 2011
Device: Kindle Paperwhite
Unable to set button default action for Prettify plugin

Hi. When I press the 'set as default action' button for the resolution I want, the following is the error:

name 'unicode' is not defined.

calibre, version 5.38.0
ERROR: Unhandled exception: <b>NameError</b>:name 'unicode' is not defined

calibre 5.38 [64bit] embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: en_GB
Successfully initialized third party plugins: DeDRM (7, 2, 1) && Goodreads (1, 5, 3) && Goodreads_Rating (3, 1, 0) && Hyphenate This! (0, 1, 3) && Kindle hi-res covers (0, 5, 0) && Prettify Cover (1, 5, 0)
Traceback (most recent call last):
File "calibre_plugins.prettify_cover.config", line 170, in set_as_default
NameError: name 'unicode' is not defined
LWTBP is offline   Reply With Quote
Old 03-17-2022, 05:53 PM   #49
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by LWTBP View Post
Hi. When I press the 'set as default action' button for the resolution I want, the following is the error:

name 'unicode' is not defined.

Successfully initialized third party plugins: DeDRM (7, 2, 1) && Goodreads (1, 5, 3) && Goodreads_Rating (3, 1, 0) && Hyphenate This! (0, 1, 3) && Kindle hi-res covers (0, 5, 0) && Prettify Cover (1, 5, 0)
Have you tried using the Prettify Cover 1.5.3 plugin posted in message #47 in this thread? It's the message immediately prior to your post.
DNSB is offline   Reply With Quote
Old 03-18-2022, 05:53 AM   #50
LWTBP
Member
LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.
 
LWTBP's Avatar
 
Posts: 16
Karma: 222088
Join Date: Aug 2011
Device: Kindle Paperwhite
Hey. Yes, I tried 1.5.3 and I'm getting the same error. Also tried to add the default resolution of 758x1024 and make it the default. Didn't work. Are you facing this error?
LWTBP is offline   Reply With Quote
Advert
Old 03-19-2022, 09:14 PM   #51
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by LWTBP View Post
Hey. Yes, I tried 1.5.3 and I'm getting the same error. Also tried to add the default resolution of 758x1024 and make it the default. Didn't work. Are you facing this error?
I haven't used Prettify Cover in quite a while. I found that I prefer using GIMP directly for the individualized control over the images. I hadn't tried changing the default resolution from the 1000x1500 that I had set back then. I just tried now and get the unicode error.

Looking at the config.py file, line 170 reads:
Code:
        if unicode(self.item(row, 2).text()).strip() == 'Default':
and line 173 reads:
Code:
        for update_row in range(0, self.rowCount()):
I'm not the greatest programmer around but I do seem to remember that in Python 2, unicode was a specialized variant of the str function whereas Python 3 pretty much uses Unicode as it's default. There was also a use of xrange in line 173. Changing the unicode to str and the xrange to range allows me to add a new size and make it the default. Please note that this will break Python 2 compatibility so I bumped the minimum calibre version in __init__.py to 5.0.0.

I've attached the modified file to this message if anyone wants to give it a try.
Attached Files
File Type: zip PrettifyCover.zip (94.0 KB, 131 views)
DNSB is offline   Reply With Quote
Old 03-20-2022, 08:36 AM   #52
LWTBP
Member
LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.LWTBP ought to be getting tired of karma fortunes by now.
 
LWTBP's Avatar
 
Posts: 16
Karma: 222088
Join Date: Aug 2011
Device: Kindle Paperwhite
Smile

Quote:
Originally Posted by DNSB View Post
I haven't used Prettify Cover in quite a while. I found that I prefer using GIMP directly for the individualized control over the images. I hadn't tried changing the default resolution from the 1000x1500 that I had set back then. I just tried now and get the unicode error.

Looking at the config.py file, line 170 reads:
Code:
        if unicode(self.item(row, 2).text()).strip() == 'Default':
and line 173 reads:
Code:
        for update_row in range(0, self.rowCount()):
I'm not the greatest programmer around but I do seem to remember that in Python 2, unicode was a specialized variant of the str function whereas Python 3 pretty much uses Unicode as it's default. There was also a use of xrange in line 173. Changing the unicode to str and the xrange to range allows me to add a new size and make it the default. Please note that this will break Python 2 compatibility so I bumped the minimum calibre version in __init__.py to 5.0.0.

I've attached the modified file to this message if anyone wants to give it a try.
That solved the problem. I really appreciate it. Thank you!
LWTBP is offline   Reply With Quote
Old 03-20-2022, 03:35 PM   #53
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by LWTBP View Post
That solved the problem. I really appreciate it. Thank you!
Please post if you run into any issues. What I did was a quick hack job and while I didn't see any issues in my limited testing, there is no warranty.

Hopefully, m1d1 will be able to fix the issue without breaking Python 2 compatibility.
DNSB is offline   Reply With Quote
Old 07-26-2022, 03:36 AM   #54
Polipipianovic
Junior Member
Polipipianovic began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2022
Device: Kobo Glo
Any chance this plugin gets an update for Calibre 6?
Polipipianovic is offline   Reply With Quote
Old 07-26-2022, 10:52 AM   #55
m1d1
Enthusiast
m1d1 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Aug 2015
Location: Stuttgart - Germany
Device: Pocketbook Touch HD
Quote:
Originally Posted by Polipipianovic View Post
Any chance this plugin gets an update for Calibre 6?
I'm working on it.
m1d1 is offline   Reply With Quote
Old 07-26-2022, 11:32 AM   #56
Polipipianovic
Junior Member
Polipipianovic began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2022
Device: Kobo Glo
Quote:
Originally Posted by m1d1 View Post
I'm working on it.
Great!
Polipipianovic is offline   Reply With Quote
Old 07-26-2022, 03:12 PM   #57
m1d1
Enthusiast
m1d1 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Aug 2015
Location: Stuttgart - Germany
Device: Pocketbook Touch HD
1.6.0

- fixes for Calibre 6
- removed GIMP related features (content-aware fill, edit with gimp, etc.)
m1d1 is offline   Reply With Quote
Old 07-27-2022, 10:57 PM   #58
emoana
Junior Member
emoana began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2022
Device: Kobo Libra H2O
@m1d1

Thanks so much for your work on this plugin. I have been using it for a while and find it very useful. I had some troubles (similar to those issues posted above), however, prettify cover, version 1.6.0 has resolved them.

Just to confirm:
calibre, version 6.1.0
prettify cover, version 1.6.0
all features working.

emoana is offline   Reply With Quote
Old 08-02-2022, 07:35 AM   #59
Polipipianovic
Junior Member
Polipipianovic began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2022
Device: Kobo Glo
Quote:
Originally Posted by m1d1 View Post
- fixes for Calibre 6
- removed GIMP related features (content-aware fill, edit with gimp, etc.)
Thank you so much
Polipipianovic is offline   Reply With Quote
Old 09-13-2022, 07:20 AM   #60
Roke97
Junior Member
Roke97 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2022
Device: Pocketbook Era, Kindle Paperwhite 10th gen
Multiple Covers

Is it possible to prettify multiple covers at once? same BG color for everyone? Or do I have to click and accept it for every single cover?
Roke97 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Resize Cover kiwidude Plugins 95 03-16-2024 11:55 PM
[GUI Plugin] Generate Cover kiwidude Plugins 811 03-16-2024 11:31 PM
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 492 10-25-2022 08:13 AM
[GUI Plugin] Hyphenate This! bookbinder Plugins 0 05-06-2015 01:07 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 10:12 AM.


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