#1124110 AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

#1124110#5
Date:
2025-12-27 23:51:19 UTC
From:
To:
Dear Maintainer,

I have a short script using glue-sprite to make a CSS spritesheet. In Bookworm
it worked fine, but after upgrading to Trixie this year I tried to run it again
and it now fails for me, producing the following error:

```

Format 'img' for sprite 'my-sprite' needs rebuild...

================================================================================
You've found a bug! Please, raise an issue attaching the following traceback
https://github.com/jorgebastida/glue/issues/new
--------------------------------------------------------------------------------
Version: 0.13
Python: 3.13.5 (main, Jun 25 2025, 18:55:22) [GCC 14.2.0]
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/glue/bin.py", line 235, in main
    manager.process()
    ~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/glue/managers/base.py", line 14, in process
    self.save()
    ~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/glue/managers/base.py", line 45, in save
    format.build()
    ~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/glue/formats/base.py", line 41, in build
    self.save(ratio=ratio)
    ~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/glue/formats/img.py", line 143, in save
    PILImage.ANTIALIAS)
    ^^^^^^^^^^^^^^^^^^
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/glue-sprite", line 33, in <module>
    sys.exit(load_entry_point('glue==0.13', 'console_scripts', 'glue-sprite')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/glue/bin.py", line 262, in main
    sys.stderr.write("PIL version: {0}\n".format(PImage.VERSION))
                                                 ^^^^^^^^^^^^^^
AttributeError: module 'PIL.Image' has no attribute 'VERSION'

```

I searched online and found a clue that the PIL ANTIALIAS constant was
removed in Pillow 10.0.0. Debian Trixie ships with python3-pil 11.1.

Is it possible this package never worked in Trixie?

Best regards