# # spec file for package python-imageio # # Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %bcond_with test_extras %{?sle15_python_module_pythons} Name: python-imageio Version: 2.36.1 Release: 1.2 Summary: Python library for reading and writing image, video, and related formats License: BSD-2-Clause URL: https://github.com/imageio/imageio Source0: https://files.pythonhosted.org/packages/source/i/imageio/imageio-%{version}.tar.gz BuildRequires: %{python_module Pillow >= 8.3.2} BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module numpy >= 1.20.0} BuildRequires: %{python_module pip} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-Pillow >= 8.3.2 Requires: python-numpy >= 1.20.0 Requires(post): update-alternatives Requires(postun): update-alternatives Recommends: libfreeimageplus3 Recommends: python-imageio-ffmpeg Recommends: python-psutil Suggests: python-astropy Suggests: python-av # not in openSUSE (yet) Suggests: python-simpleitk Suggests: python-tifffile BuildArch: noarch %if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" # GDAL is not (yet) singlespec Suggests: python3-GDAL %endif # SECTION test requirements BuildRequires: %{python_module fsspec} BuildRequires: %{python_module imageio-ffmpeg} BuildRequires: %{python_module pytest} BuildRequires: libglvnd-devel %if %{with test_extras} BuildRequires: %{python_module astropy} BuildRequires: %{python_module av} BuildRequires: %{python_module psutil} BuildRequires: %{python_module tifffile} BuildRequires: python3-GDAL %endif # /SECTION %python_subpackages %description Imageio is a Python library that provides an interface to read and write a wide range of image data, including animated images, volumetric data, and scientific formats. %prep %setup -q -n imageio-%{version} # Plugins are not executable scripts for plgpy in imageio/plugins/_*.py ; do echo "Fixing $plgpy..." sed -i -e '1{/\/usr\/bin.*python/d}' $plgpy done %build export IMAGEIO_NO_INTERNET=1 %pyproject_wheel %install export IMAGEIO_NO_INTERNET=1 %pyproject_install %python_clone -a %{buildroot}%{_bindir}/imageio_remove_bin %python_clone -a %{buildroot}%{_bindir}/imageio_download_bin %python_expand %fdupes %{buildroot}%{$python_sitelib} %check export IMAGEIO_NO_INTERNET=1 # plain openSUSE does not have the right codecs to test this ffmpeg donttest="test_ffmpeg or test_bayer_write" # unmarked online tests donttest="$donttest or test_freeimage" # fails with python 313 donttest+=" or test_gif" %pytest -ra -k "not ($donttest)" -m "not needs_internet" %post %python_install_alternative imageio_remove_bin %python_install_alternative imageio_download_bin %postun %python_uninstall_alternative imageio_remove_bin %python_uninstall_alternative imageio_download_bin %files %{python_files} %license LICENSE %doc CONTRIBUTORS.txt README.md %{python_sitelib}/imageio %{python_sitelib}/imageio-%{version}*-info %python_alternative %{_bindir}/imageio_download_bin %python_alternative %{_bindir}/imageio_remove_bin %changelog * Wed Jan 8 2025 Yunus Acar - update to 2.36.1: * Fix failing pillow test (#1110) (9a9d9f1) * Tue Nov 19 2024 Dirk Müller - update to 2.36.0: * Use bytes instead of to_bytes in pyav metadata call * Remove support for Python 3.8 * Thu Aug 29 2024 Dirk Müller - update to 2.35.1: * Ensure video stream is closed when closing the pyAV plugin * Rawpy plugin * Remove pinned numpy regression * Thu Jun 27 2024 Dirk Müller - update to 2.34.2: * Add support for numpy 2.0 * Tue May 7 2024 Dirk Müller - update to 2.34.1: * Fix bug of #1068 that getattr cannot get attribute with index directly * Mon Mar 18 2024 Dirk Müller - update to 2.34.0: * Forward constructor kwargs to PyAV * Sat Dec 16 2023 Dirk Müller - update to 2.33.1: * Replace mktemp with mkstemp when caching to disk for legacy plugins * Mon Nov 27 2023 Dirk Müller - update to 2.33.0: * Update pyav plugin to reflect AV changes * Unpin Pillow and allow versions >=10.1.0 * Support for AVIF image format * Add support for HEIF format * Raise warning instead of error when using fps in pillow * Consistently load GIF frames using the same pixel format * Refactor resolution metadata reading for TIFF and avoid failing on missing data * Add bytes to ImageResource typehints * Remove deprecations in CD * Fix typo in README.md * Fix several typos in the docs and source code comments * Add migration note for format kwarg * Thu Aug 17 2023 ecsos - Add %%{?sle15_python_module_pythons} * Fri Jun 30 2023 Matej Cepl - Clean up SPEC file. * Fri Jun 30 2023 Markéta Machová - update to 2.31.1 * Add support for Python 3.11 * Tifffile v3 support * Add audio support for ffmpeg writer * small improvements to pyav * Consistently apply color palettes by default * Add n_images to ImageProperties * Expose v3 plugins via v2 API * Decode gray 16-bit PNG as uint16 (not int32) if pillow allows * Sun Oct 16 2022 Dirk Müller - update to 2.22.1: * Raise ImportError when iio-ffmpeg is missing * Thu Sep 29 2022 Yogalakshmi Arunachalam - Update to 2.22.0 Feature * Pyav API for procedural video writing (#853) (acbcb64) - Update to v2.21.3 Fix * Raise error if fps is specified (#871) (1f8d37a) Other * Fix small typo (#873) (f59e16d) * Examples for Pyav (#865) (810a7a9) - Update to v2.21.2 Fix * Allow v3.imread to read dicom (#868) (22c98c2) Revert to asanyarray (#863) (fdaba04) Other Add missing numpy import in example (#866) (d85bfba) - Update to v2.21.1 Fix Seeking to last frame caused EoF in pyav (#855) (7ff7f02) - Update to v2.21.0 Fix Write single TIFF page for single RGB image (#851) (0f04bc9) Feature Add is_batch kwarg to pillow (#845) (21d5c73) Other Add a migration note about pillow squeezing (#850) (7c55a55) Add missin option to imwrite type hints (#848) (6da4a42) Ignore exclude_applied on legacy plugins (#844) (f082dde) Remove unneeded CD steps (#847) (0d99c51) - Update to v2.20.0 Fix Expose frame-level metadata and duration in pyav (#839) (05fcf2c) Feature Enable HTTP based streams in pyav (#838) (fb1150d) Other Fix typo in test_pyav (#846) (f89abf1) * Fri Mar 18 2022 Ben Greiner - Update to 2.16.1 * Update "python_requires" to 3.7+ (#757) (f80f068) - Release 2.16.0 Feature: * Improps and immeta (#739) (05d6f33) - Release 2.15.0 Features: * Add format_hint to v3 API (#734) (dd538ec) * Make tifffile read resolution metadata (#732) (4f7f334) - Release 2.14.0 Feature: * Allow mode=None when writing with pillow (#722) (7be2712) - Release 2.12.0 Feature: * Allow plugin objects in plugin kwarg (#689) (8f0f689) - Release 2.11.0 Feature: * Choose plugin based on extension and plugin lazy-import (#680) (bdbe699) - Release 2.10.0 Features: * Allow pillow to write/encode to byte strings (#669) (b5df806) * Add CD pipeline (#667) (6dce3ab) * Fail PIL write if extension isnt supported (0dc33d3) * Make imopen use core.Request (c51fdb0) * Mon Feb 15 2021 Ben Greiner - Update to version 2.9.0 Fixed * More robust loading of FEI SEM data (#529 by jon-lab). * Fix webcam not working on Win10 (#525). Added * Add a few standard images useful to 3D visualization. * The timeout used in HTTP requests can now be set with an environment variable (#534 by Johann Neuhauser). * The DICOM plugin can now used gdcm for compressed transfer formats. * Better support for itk/sitk plugins (#530 by Jonathan Daniel). * Test coverage and CI for ARM (#518 by odidev). - Skip python36 build: NumPy 1.20 dropped suport for Python 3.6 making python36-numpy unavailable in Tumbleweed (NEP 29) - Suggest the extras, you can test what we have in openSUSE with `osc build --with test_extras` * Mon May 25 2020 Petr Gajdos - %%python3_only -> %%python_alternative * Thu Apr 9 2020 Marketa Calabkova - Update to version 2.8.0 * (skipping version 2.7 to avoid confusion with Python v2.7.) * Added example for compressing GIFs using pygifsicle * Added support for compressed FITS images * Improved support for JPEG2000 (can now provide parameters) * More flexible setting of memory limit in mimread and mvolread * Drop support for Python 2.7 and Python 3.4. * Drop support for AVbin, use ffmpeg instead. * Many bugfixes. * Mon Mar 16 2020 Tomáš Chvátal - Fix build without python2 * Wed Apr 17 2019 Todd R - update to version 2.5.0 + The ffmpeg plugin has been refactored: * The core has been moved to a new library: imageio-ffmpeg. * That library provides platform-specific wheels that includes ffmpeg, so just ``pip install imageio-ffmpeg`` instead of the download step. * Note that this new library is py3k only. * Termination of ffmpeg subprocess is now more reliable. * The reader of the ffmpeg plugin now always reports ``inf`` as the number of frames. Use ``reader.count_frames()`` to get the actual number, or estimate it from the fps and duration in the meta data. * Removed ``CannotReadFrameError``. + Other changes: * The avbin plugin has been depreacted and will be removed in a future version. * Imnproved speed for PIL and FFMPEG plugsins by avoiding memory copies. * Update the included tiffile library. * Support for SimpleITK. * Speed up tiffile plugin when writing to something else than a filename. * Fix that writing to a file object would not work for some plugins. * Can now pass image data to the write functions as anything that resolves to a numpy array with a numeric dtype. * One can now read from a memoryview. * Fix error related to paletted BMP with the Pillow plugin. * Improved logging. - update to version 2.4.1 * Fix installation issue on flavors of Ubuntu 14.04 /w Python 2.7 (#378). * Use `np.frombuffer` instead of `np.fromstring` in some cases. - update to version 2.4.0 * Renamed ``Image`` class to ``Array`` and add documentation for this ndarray subclass. * Reading from HTTP and zipfiles has been improved and better documented. * Improvements to reading and writing of Tiff metadata (by Lukas Schrangl). * Better dealing of tifffile dependencies on Python 2.7 (#330 and #337 by Chris Barnes). * Reader for the SPE format (#358 by lschr). * Better termination of FFMPEG when reading from webcam (#346 by Dennis Vang). * FFMPEG support for reading 16bit videos (#342 by Peter Minin). * Mon Mar 4 2019 John Vandenberg - Remove bcond preventing tests from running, use IMAGEIO_NO_INTERNET to activate tests which can run without the internet, and skip currently failing tests on Python 2 and 3 - Remove unused test dependency nose - Recommend Pillow as it is a mandatory dependency of the test suite * Tue Dec 4 2018 Matej Cepl - Remove superfluous devel dependency for noarch package * Wed Sep 5 2018 Matěj Cepl - Fix BuildRequires ("freeimage-devel" instead of "libfreeimage3"), and remove superfluous Requires for libfreeimage3. - Remove shebangs from non-scripts in shipped plugins. - Add python-imageio-rpmlintrc ... we install zero-length files. * Sat Apr 21 2018 arun@gmx.de - specfile: * changed from zip to tar.gz on pypi * added binaries: imagio_{download,remove}_bin - update to version 2.3.0: * Console entry points for binary downloads (by Paul Mueller). * Dropped support for Python 2.6, 3.2 and 3.3. * Reading images from a url can now also have "suffixes" like "?query=foo". * The "mimwrite()" and "mvolwrite()" functions also work with generators. * Fix rounding of float data. * New Lytro plugin (by Maximilian Schambach). * New plugin based on BSDF format (for images/volumes and series thereof, * including support for random access and streaming). * TIFFFILE update to latest "tifffile.py" implementation. * DICOM fix that could fail in the presence of a directory. * PILLOW improvements to API to provide same functionality as Scipy's "imread()". * PILLOW fix for Gamma correction (#302). * PILLOW now allows JPEG images to be read from a url. * PILLOW fix determining of grayscale in 1 bit paletted images. * FFMPEG improved device name parsing (by Dennis van Gerwen). * FFMPEG now allows more control of position of extra parameters. * FFMPEG improved parsing of fps from ffmpeg info. * FFMPEG reader allows has "fps" argument to force reading at a specific FPS. - changes from version 2.2.0: * New format for grabbing screenshots (for Windows and OS X). * New format for grabbing image data from clipboard (Window only). * Multipage Tiff files can now be read using "volread()" to obtain the image data as one array. * Updated the ffmpeg executables that imageio provides. * The ffmpeg format can now also use the ffmpeg exe provided by the ffmpeg conda package ("conda install ffmpeg -c conda-forge"). * Fixes to ffmpeg format in general. * Improve docs and rounding in animated GIF duration. * Fix for setting number of loops in animated GIF. * Fixes for transparent images in Pillow. * Fixes for float indexing that is disallowed in new Numpy (Freeimage plugin). * Fix for using missing "close()" on Pillow images. * Updated version of tiffile plugin. * Sat Mar 3 2018 jengelh@inai.de - Update descriptions. * Wed May 17 2017 toddrme2178@gmail.com - Implement single-spec version - Fix source URL - Update to version 2.1.2 Large number of changes, see: https://imageio.readthedocs.io/en/latest/releasenotes.html#version-2-1-2-02-02-2017 * Tue Dec 9 2014 toddrme2178@gmail.com - Initial version