Name: python-resize-image Version: 1.1.20 Release: 1%{?dist} Summary: Small helpers to resize, crop and fit images with Pillow # setup.py declares MIT; the sdist carries no licence text and the upstream # repository has no tags. License: MIT URL: https://github.com/VingtCinq/python-resize-image Source0: %{pypi_source python-resize-image} BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: python-resize-image wraps Pillow with functions that resize an image to fit a width or height, cover or contain a box, crop to a centered rectangle, or make a thumbnail, refusing sizes larger than the source unless told otherwise.} %description %{_description} %package -n python3-resize-image Summary: %{summary} %description -n python3-resize-image %{_description} %prep %autosetup -n python-resize-image-%{version} # find_packages() would install the tests as a top-level "tests" package. sed -i 's/packages=find_packages()/packages=find_packages(exclude=["tests"])/' setup.py grep -q 'exclude=\["tests"\]' setup.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -L resizeimage %check # resizeimage.helpers is Python 2 only (cStringIO) and unused by the API. %pyproject_check_import -e resizeimage.helpers # The sdist lacks the tests' sample image. %{py3_test_envvars} %{python3} - <<'PYEOF' from PIL import Image from resizeimage import resizeimage from resizeimage.imageexceptions import ImageSizeError img = Image.new("RGB", (400, 200), (10, 20, 30)) assert resizeimage.resize_cover(img, [100, 100]).size == (100, 100) assert resizeimage.resize_width(img, 100).size == (100, 50) assert resizeimage.resize_contain(img, [100, 100]).size == (100, 100) assert resizeimage.resize_thumbnail(img, [100, 100]).size == (100, 50) try: resizeimage.resize_width(img, 800) except ImageSizeError: pass else: raise AssertionError("upscaling was not refused") PYEOF %files -n python3-resize-image -f %{pyproject_files} %doc README.rst %changelog * Sun Nov 01 2026 Morgan Hough - 1.1.20-1 - Initial package