python-barcode icon indicating copy to clipboard operation
python-barcode copied to clipboard

Incompatibility with pillow 10.0.1

Open Nadern96 opened this issue 1 year ago • 1 comments

        barcode_format = barcode.get_barcode_class('code128')
        code = barcode_format(input, writer=ImageWriter(), )
        code_path = BASE_PATH + 'code'
        path = code.save(code_path, {"font_size": font_size})
width, height = font.getsize(subtext)\nAttributeError: 'FreeTypeFont' object has no attribute 'getsize'

Nadern96 avatar Feb 26 '24 12:02 Nadern96

Which version are you using?

WhyNotHugo avatar Feb 27 '24 20:02 WhyNotHugo

The error AttributeError: 'FreeTypeFont' object has no attribute 'getsize' occurs because Pillow 10, removed the method getsize.

richardmarktl avatar Apr 04 '24 09:04 richardmarktl

On Thu, 4 Apr 2024, at 11:19, richardmarktl wrote:

The error AttributeError: 'FreeTypeFont' object has no attribute 'getsize' occurs because Pillow 10, removed the method getsize.

Which version are you using?

WhyNotHugo avatar Apr 04 '24 09:04 WhyNotHugo

Which version are you using?

10.3.0

richardmarktl avatar Apr 04 '24 10:04 richardmarktl

The latest version of this library is 0.15.1.

WhyNotHugo avatar Apr 04 '24 10:04 WhyNotHugo

I meant to ask which version of python-barcode, not which version or pillow.

WhyNotHugo avatar Apr 04 '24 10:04 WhyNotHugo

The full stack trace is also useful in these situations.

WhyNotHugo avatar Apr 04 '24 10:04 WhyNotHugo

I upgraded bar-code package to 0.15.1, also upgraded pillow to 10.3.0, it seems to be working

Nadern96 avatar Apr 04 '24 21:04 Nadern96

This was likely https://github.com/WhyNotHugo/python-barcode/issues/163

WhyNotHugo avatar Apr 04 '24 21:04 WhyNotHugo

exactly, thanks for your time.


Von: Hugo @.> Gesendet: Thursday, April 4, 2024 11:56:16 PM An: WhyNotHugo/python-barcode @.> Cc: richardmarktl @.>; Comment @.> Betreff: Re: [WhyNotHugo/python-barcode] Incompatibility with pillow 10.0.1 (Issue #221)

This was likely https://github.com/WhyNotHugo/python-barcode/issues/163

— Reply to this email directly, view it on GitHubhttps://github.com/WhyNotHugo/python-barcode/issues/221#issuecomment-2038300119, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AACKPHCCOU5E7EMUJGPFIXLY3XEABAVCNFSM6AAAAABD2DEUZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZYGMYDAMJRHE. You are receiving this because you commented.Message ID: @.***>

richardmarktl avatar Apr 05 '24 10:04 richardmarktl