problems after update to Debian 13 with Stacked Windrose Image Generator extension from gjr80

193 views
Skip to first unread message

Christian Peters

unread,
Aug 10, 2025, 2:52:30 PMAug 10
to weewx-user
Hi all, 

I noticed that sadly gjr80 and all his great stuff on GIT for weewx seems to be gone!?

Now my Stacked Windrose Image Generator extension stops working on Debian13 AND WEEX 5.1.0 with this error:

 Caught unrecoverable exception in generator 'user.stackedwindrose.StackedWindRoseImageGenerator'
2025-08-10T20:42:38.140846+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****  type object 'ImageDraw' has no attribute 'textsize'
2025-08-10T20:42:38.143494+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****  Traceback (most recent call last):
2025-08-10T20:42:38.143695+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 248, in run
2025-08-10T20:42:38.143873+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****      obj.start()
2025-08-10T20:42:38.144061+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****      ~~~~~~~~~^^
2025-08-10T20:42:38.144194+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 465, in start
2025-08-10T20:42:38.144371+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****      self.run()
2025-08-10T20:42:38.144510+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****      ~~~~~~~~^^
2025-08-10T20:42:38.144607+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****    File "/etc/weewx/bin/user/stackedwindrose.py", line 228, in run
2025-08-10T20:42:38.144717+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****      self.gen_images(self.gen_ts)
2025-08-10T20:42:38.144835+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****      ~~~~~~~~~~~~~~~^^^^^^^^^^^^^
2025-08-10T20:42:38.144944+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****    File "/etc/weewx/bin/user/stackedwindrose.py", line 447, in gen_images
2025-08-10T20:42:38.145061+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****      text_w, text_h = self.draw.textsize("0 (100%)",
2025-08-10T20:42:38.145204+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****                       ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
2025-08-10T20:42:38.145367+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****                                          font=self.legend_font)
2025-08-10T20:42:38.145489+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****                                          ^^^^^^^^^^^^^^^^^^^^^^
2025-08-10T20:42:38.145747+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****    File "/etc/weewx/bin/user/stackedwindrose.py", line 822, in textsize
2025-08-10T20:42:38.145951+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****      return ImageDraw.ImageDraw.textsize(self, string, **options)
2025-08-10T20:42:38.146199+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-10T20:42:38.146510+02:00 weewx weewxd[3909]: Traceback (most recent call last):
2025-08-10T20:42:38.148982+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****  AttributeError: type object 'ImageDraw' has no attribute 'textsize'
2025-08-10T20:42:38.149142+02:00 weewx weewxd[3909]:   File "/usr/share/weewx/weewx/reportengine.py", line 248, in run
2025-08-10T20:42:38.151192+02:00 weewx weewxd[3909]:     obj.start()
2025-08-10T20:42:38.152532+02:00 weewx weewxd[3909]:     ~~~~~~~~~^^
2025-08-10T20:42:38.153693+02:00 weewx weewxd[3909]:   File "/usr/share/weewx/weewx/reportengine.py", line 465, in start
2025-08-10T20:42:38.154853+02:00 weewx weewxd[3909]:     self.run()
2025-08-10T20:42:38.156503+02:00 weewx weewxd[3909]:     ~~~~~~~~^^
2025-08-10T20:42:38.157701+02:00 weewx weewxd[3909]:   File "/etc/weewx/bin/user/stackedwindrose.py", line 228, in run
2025-08-10T20:42:38.158983+02:00 weewx weewxd[3909]:     self.gen_images(self.gen_ts)
2025-08-10T20:42:38.160126+02:00 weewx weewxd[3909]:     ~~~~~~~~~~~~~~~^^^^^^^^^^^^^
2025-08-10T20:42:38.161340+02:00 weewx weewxd[3909]:   File "/etc/weewx/bin/user/stackedwindrose.py", line 447, in gen_images
2025-08-10T20:42:38.162448+02:00 weewx weewxd[3909]:     text_w, text_h = self.draw.textsize("0 (100%)",
2025-08-10T20:42:38.163580+02:00 weewx weewxd[3909]:                      ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
2025-08-10T20:42:38.164748+02:00 weewx weewxd[3909]:                                         font=self.legend_font)
2025-08-10T20:42:38.165938+02:00 weewx weewxd[3909]:                                         ^^^^^^^^^^^^^^^^^^^^^^
2025-08-10T20:42:38.167060+02:00 weewx weewxd[3909]:   File "/etc/weewx/bin/user/stackedwindrose.py", line 822, in textsize
2025-08-10T20:42:38.168423+02:00 weewx weewxd[3909]:     return ImageDraw.ImageDraw.textsize(self, string, **options)
2025-08-10T20:42:38.169717+02:00 weewx weewxd[3909]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-10T20:42:38.170863+02:00 weewx weewxd[3909]: AttributeError: type object 'ImageDraw' has no attribute 'textsize'
2025-08-10T20:42:38.172150+02:00 weewx weewxd[3909]: ERROR weewx.reportengine:         ****  Generator terminated

Seems to be because some changes made Pillow 10. 
My version of stackewindrose extension is Version: 3.0., Date: 7 June 2020

Has someone forked it or patched this to get it back working with Pillow 10. 
Sadly I don't have any skills regarding python. Or can I downgrade to Vers 9.x....!? 


Thansk in advance! 

Regards,

Christain 

Tom Keffer

unread,
Aug 10, 2025, 3:22:58 PMAug 10
to weewx...@googlegroups.com
Your analysis is correct. You have two choices: 

1. Downgrade to Pillow V9.5, which still uses textsize.
2. Make the necessary changes to stackedwindrose.py yourself.  This involves mostly substituting "textlength" everywhere you see "textsize", except that the latter returns a 2-way tuple of (width, length), while the former is just a simple scalar of width.

-tk



--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/9ce297c8-4b76-497c-9faf-8d0d1d4ab2ffn%40googlegroups.com.

Tom Keffer

unread,
Aug 10, 2025, 3:25:37 PMAug 10
to weewx...@googlegroups.com
One other thing: if you have access to a decent AI coding engine, it can probably do the necessary changes. Just feed it stackedwindrose.py and ask it to make the necessary changes to go from V9.5 to V10.0

I've been using AI coding engines more and more and have been stunned by just how effective they can be. 

We're all obsolete.

-tk

vince

unread,
Aug 10, 2025, 3:27:53 PMAug 10
to weewx-user
You have an old version of stackedwindrose.py - you need this version which works with pillow 10.x

  6 July 2023           v3.0.2
      - fix error due to deprecated PIL.ImageDraw.textsize() method being
        removed from PIL 10.0

I have a .tgz of that version and can put up a github repo later today if I get a chance.  Have some patience :-)

vince

unread,
Aug 10, 2025, 3:51:25 PMAug 10
to weewx-user
ok Christian - I put a quick repo up at https://github.com/vinceskahan/weewx-stackedwindrose with 3.0.2

Christian Peters

unread,
Aug 10, 2025, 4:35:04 PMAug 10
to weewx-user
@vince: thank you very much for this quick help and setting up the GIT repo. Extension is working again! 🙂

@tk: I started a try to let ChatGPT resolve the issue, but I get new issues....so vince was the winner...! 😂

But yes, amazing and creepy what is possibel...!

Thank you both for your suggestins and quicl help!

Regards,

Christian
Message has been deleted
Message has been deleted

vince

unread,
Oct 25, 2025, 12:15:46 PM (12 days ago) Oct 25
to weewx-user
update - wget https://github.com/vinceskahan/upstream-repos/raw/refs/heads/main/weewx-stackedwindrose.tgz 

I reorganized a few months ago so locations have changed.  All my stashed upstream stuff is in https://github.com/vinceskahan/upstream-repos/ - be sure to read the README file for how to download pieces rather than the whole directory of many upstream pieces of software

On Saturday, October 25, 2025 at 4:38:14 AM UTC-7 Auchtermuchty Weather wrote:
Your URL is now a 404 page :(

I am having the same sort of problems, if you could let me have your version with the problem fixed I'd be very grateul.

Auchtermuchty Weather

unread,
Oct 25, 2025, 2:32:03 PM (12 days ago) Oct 25
to weewx-user
I've actually managed to fix my code. I'm amazed! I made a function that returns width & height from the text & font:

    def get_hw(  text, font ):
        left, top, right, bottom = font.getbbox( text )
        width = right - left
        height = bottom - top

        return width, height

So, e.g.,
    self.title_width, self.title_height = self.draw.textsize(self.title, font=self.label_font)

becomes
    self.title_width, self.title_height = self.get_hw( self.title, self.label_font )

Will be sorting out my own GitHub maybe tomorrow and testing it on a fresh Debian 13 installation.

The following were the resources that helped me do that:

Auchtermuchty Weather

unread,
Oct 26, 2025, 4:30:10 AM (11 days ago) Oct 26
to weewx-user
To add, the ImageFont PIL library needs importing:

    from PIL import Image, ImageColor, ImageDraw, ImageFont

Auchtermuchty Weather

unread,
Oct 26, 2025, 3:26:04 PM (11 days ago) Oct 26
to weewx-user
To add, tested on clean versions of Debian 12, Debian 13 and the latest Raspberry Pi OS. all are fine though python3-six needs to be installed. 
Reply all
Reply to author
Forward
0 new messages