Public bug reported:

Package: pillow 12.1.1-2ubuntu1.5 (resolute-security / resolute-
updates), amd64

After upgrading python3-pil from 12.1.1-2ubuntu1.4 to 12.1.1-2ubuntu1.5,
every resize that uses the NEAREST filter fails in the C core. Because
Pillow always uses NEAREST for mode "P" and "1" images, resizing any
palette or bilevel image fails regardless of the filter requested.

Reproducer:

from PIL import Image
Image.new("L", (40, 30)).resize((10, 7), Image.Resampling.NEAREST)
Image.new("P", (40, 30)).resize((10, 7))
Actual result (12.1.1-2ubuntu1.5):

SystemError: <method 'resize' of 'ImagingCore' objects> returned NULL without 
setting an exception
Expected result: a resized image, as with 12.1.1-2ubuntu1.4 and upstream Pillow 
12.1.1 from PyPI (both tested on the same machine).

Observations:

Fails for NEAREST in every mode tested (1, L, P, RGB, RGBA, I, F), with and 
without a box argument.
BOX, BILINEAR, HAMMING, BICUBIC and LANCZOS work for L, RGB, RGBA, I and F. For 
"1" and "P" they fail too, because Pillow forces NEAREST for those modes.
Image.transform(..., Image.Transform.AFFINE, ..., Image.Resampling.NEAREST) 
still works.
Likely introduced by one of the patches in this upload that touch 
src/_imaging.c / src/libImaging (e.g. CVE-2026-112394.patch, which changes 
_imaging.c and Imaging.h).
Impact: applications that create thumbnails (e.g. Odoo, which resizes every 
uploaded image) can no longer process palette PNGs or GIFs.

** Affects: pillow (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174424

Title:
  12.1.1-2ubuntu1.5 regression: Image.resize with NEAREST raises
  SystemError for all modes

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pillow/+bug/2174424/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to