Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pyssim for openSUSE:Factory checked in at 2023-10-06 21:14:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pyssim (Old) and /work/SRC/openSUSE:Factory/.python-pyssim.new.28202 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyssim" Fri Oct 6 21:14:00 2023 rev:5 rq:1115888 version:0.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pyssim/python-pyssim.changes 2023-03-06 18:56:35.000980647 +0100 +++ /work/SRC/openSUSE:Factory/.python-pyssim.new.28202/python-pyssim.changes 2023-10-06 21:16:44.340831573 +0200 @@ -1,0 +2,8 @@ +Thu Oct 5 08:53:32 UTC 2023 - Markéta Machová <mmach...@suse.com> + +- Update to 0.6 + * support numpy 1.20 +- Drop upstreamed numpy120.patch +- add upstream pillow10.patch + +------------------------------------------------------------------- Old: ---- numpy120.patch pyssim-0.5.tar.gz New: ---- pillow10.patch pyssim-0.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyssim.spec ++++++ --- /var/tmp/diff_new_pack.v2Eupd/_old 2023-10-06 21:16:45.536874784 +0200 +++ /var/tmp/diff_new_pack.v2Eupd/_new 2023-10-06 21:16:45.540874929 +0200 @@ -18,7 +18,7 @@ %global skip_python36 1 Name: python-pyssim -Version: 0.5 +Version: 0.6 Release: 0 Summary: Structured Similarity Image Metric (SSIM) License: MIT @@ -26,8 +26,8 @@ URL: https://github.com/jterrace/pyssim Source: https://files.pythonhosted.org/packages/source/p/pyssim/pyssim-%{version}.tar.gz Patch0: Pillow-imports.patch -# PATCH-FIX-UPSTREAM numpy120.patch gh#jterrace/pyssim#44 -Patch1: numpy120.patch +# PATCH-FIX-UPSTREAM https://github.com/jterrace/pyssim/commit/db4296c12ca9c027eb9cd61b52195a78dfcc6711 Replace Image.ANTIALIAS with Image.LANCZOS +Patch1: pillow10.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros ++++++ pillow10.patch ++++++ >From db4296c12ca9c027eb9cd61b52195a78dfcc6711 Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+t...@users.noreply.github.com> Date: Sun, 27 Aug 2023 11:36:25 -0700 Subject: [PATCH] Replace Image.ANTIALIAS with Image.LANCZOS This adds compatibility with Pillow 10, when ANTIALIAS was removed. Meanwhile, LANCZOS has been an alias since Pillow 2.7.0. Co-authored-by: emilylange <g...@emilylange.de> --- SSIM_CW-SSIM_comparison.ipynb | 8 ++++---- ssim/ssimlib.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SSIM_CW-SSIM_comparison.ipynb b/SSIM_CW-SSIM_comparison.ipynb index e713ffd..68ea8ce 100644 --- a/SSIM_CW-SSIM_comparison.ipynb +++ b/SSIM_CW-SSIM_comparison.ipynb @@ -34,19 +34,19 @@ "size = (256,256)\n", "\n", "im = Image.open('test-images/test3-orig.jpg')\n", - "im = im.resize(size, Image.ANTIALIAS)\n", + "im = im.resize(size, Image.LANCZOS)\n", "\n", "# slightly rotated image\n", "im_rot = Image.open('test-images/test3-rot.jpg')\n", - "im_rot = im_rot.resize(size, Image.ANTIALIAS)\n", + "im_rot = im_rot.resize(size, Image.LANCZOS)\n", "\n", "# slightly modified lighting conditions\n", "im_lig = Image.open('test-images/test3-lig.jpg')\n", - "im_lig = im_lig.resize(size, Image.ANTIALIAS)\n", + "im_lig = im_lig.resize(size, Image.LANCZOS)\n", "\n", "# image cropped\n", "im_cro = Image.open('test-images/test3-cro.jpg')\n", - "im_cro = im_cro.resize(size, Image.ANTIALIAS)" + "im_cro = im_cro.resize(size, Image.LANCZOS)" ] }, { diff --git a/ssim/ssimlib.py b/ssim/ssimlib.py index 693f951..b40a8d4 100644 --- a/ssim/ssimlib.py +++ b/ssim/ssimlib.py @@ -45,7 +45,7 @@ def __init__(self, img, gaussian_kernel_1d=None, size=None): # Resize image if size is defined and different # from original image if size and size != self.img.size: - self.img = self.img.resize(size, Image.ANTIALIAS) + self.img = self.img.resize(size, Image.LANCZOS) # Set the size of the image self.size = self.img.size ++++++ pyssim-0.5.tar.gz -> pyssim-0.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyssim-0.5/CHANGES.md new/pyssim-0.6/CHANGES.md --- old/pyssim-0.5/CHANGES.md 2022-06-20 14:39:10.000000000 +0200 +++ new/pyssim-0.6/CHANGES.md 2023-03-19 18:34:13.000000000 +0100 @@ -1,25 +1,38 @@ # Changelog +## 0.6 + +* Update supported python versions to 3.7 through 3.11. +* Support numpy 1.20. + +## 0.5 + +* Add timing code for SSIM and CW-SSIM +* Create MANIFEST.in +* Add Python 3.6 support. +* Fix pylint errors. +* Fix Travis CI embed widget. + ## 0.4 -- Packaging fixes. +* Packaging fixes. ## 0.3 -- Drop support for Python 3.2, add support for 3.4 and 3.5. -- Now licensed under MIT. -- Normalize gaussian kernel to fix issue #9. -- Added support for CW-SSIM algorithm. +* Drop support for Python 3.2, add support for 3.4 and 3.5. +* Now licensed under MIT. +* Normalize gaussian kernel to fix issue #9. +* Added support for CW-SSIM algorithm. ## 0.2 -- Library now works on Python 3.2. -- Automated testing using Travis CI. -- Library is now lint clean. -- Automatically resize images. -- Internal refactoring using objects instead of functions. -- Minor performance improvements. +* Library now works on Python 3.2. +* Automated testing using Travis CI. +* Library is now lint clean. +* Automatically resize images. +* Internal refactoring using objects instead of functions. +* Minor performance improvements. ## 0.1 -- Original Release. +* Original Release. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyssim-0.5/PKG-INFO new/pyssim-0.6/PKG-INFO --- old/pyssim-0.5/PKG-INFO 2022-06-20 14:41:34.340363300 +0200 +++ new/pyssim-0.6/PKG-INFO 2023-03-19 20:43:37.784897800 +0100 @@ -1,11 +1,10 @@ -Metadata-Version: 2.1 -Name: pyssim -Version: 0.5 -Summary: Module for computing Structured Similarity Image Metric (SSIM) in Python -Home-page: https://github.com/jterrace/pyssim -Author: Antoine Vacavant, Christopher Godfrey, Jeff Terrace -Author-email: jterr...@gmail.com -License: MIT License -Platform: any -License-File: LICENSE.md -License-File: AUTHORS.md +Metadata-Version: 1.0 +Name: pyssim +Version: 0.6 +Summary: Module for computing Structured Similarity Image Metric (SSIM) in Python +Home-page: https://github.com/jterrace/pyssim +Author: Antoine Vacavant, Christopher Godfrey, Jeff Terrace +Author-email: jterr...@gmail.com +License: MIT License +Description: UNKNOWN +Platform: any diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyssim-0.5/pyssim.egg-info/PKG-INFO new/pyssim-0.6/pyssim.egg-info/PKG-INFO --- old/pyssim-0.5/pyssim.egg-info/PKG-INFO 2022-06-20 14:41:33.000000000 +0200 +++ new/pyssim-0.6/pyssim.egg-info/PKG-INFO 2023-03-19 20:43:37.000000000 +0100 @@ -1,11 +1,10 @@ -Metadata-Version: 2.1 -Name: pyssim -Version: 0.5 -Summary: Module for computing Structured Similarity Image Metric (SSIM) in Python -Home-page: https://github.com/jterrace/pyssim -Author: Antoine Vacavant, Christopher Godfrey, Jeff Terrace -Author-email: jterr...@gmail.com -License: MIT License -Platform: any -License-File: LICENSE.md -License-File: AUTHORS.md +Metadata-Version: 1.0 +Name: pyssim +Version: 0.6 +Summary: Module for computing Structured Similarity Image Metric (SSIM) in Python +Home-page: https://github.com/jterrace/pyssim +Author: Antoine Vacavant, Christopher Godfrey, Jeff Terrace +Author-email: jterr...@gmail.com +License: MIT License +Description: UNKNOWN +Platform: any diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyssim-0.5/pyssim.egg-info/entry_points.txt new/pyssim-0.6/pyssim.egg-info/entry_points.txt --- old/pyssim-0.5/pyssim.egg-info/entry_points.txt 2022-06-20 14:41:33.000000000 +0200 +++ new/pyssim-0.6/pyssim.egg-info/entry_points.txt 2023-03-19 20:43:37.000000000 +0100 @@ -1,2 +1,3 @@ [console_scripts] pyssim = ssim.__main__:main + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyssim-0.5/setup.cfg new/pyssim-0.6/setup.cfg --- old/pyssim-0.5/setup.cfg 2022-06-20 14:41:34.341363200 +0200 +++ new/pyssim-0.6/setup.cfg 2023-03-19 20:43:37.785895000 +0100 @@ -1,7 +1,7 @@ -[wheel] -universal = True - -[egg_info] -tag_build = -tag_date = 0 - +[wheel] +universal = True + +[egg_info] +tag_build = +tag_date = 0 + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyssim-0.5/setup.py new/pyssim-0.6/setup.py --- old/pyssim-0.5/setup.py 2022-06-20 14:40:28.000000000 +0200 +++ new/pyssim-0.6/setup.py 2023-03-19 20:38:34.000000000 +0100 @@ -5,7 +5,7 @@ setup( name='pyssim', - version='0.5', + version='0.6', description=('Module for computing Structured Similarity Image Metric ' '(SSIM) in Python'), author='Antoine Vacavant, Christopher Godfrey, Jeff Terrace', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyssim-0.5/ssim/utils.py new/pyssim-0.6/ssim/utils.py --- old/pyssim-0.5/ssim/utils.py 2022-06-20 14:39:10.000000000 +0200 +++ new/pyssim-0.6/ssim/utils.py 2023-03-19 17:44:55.000000000 +0100 @@ -2,31 +2,29 @@ from __future__ import absolute_import -import numpy -from numpy.ma.core import exp +import numpy as np import scipy.ndimage from ssim.compat import ImageOps + def convolve_gaussian_2d(image, gaussian_kernel_1d): """Convolve 2d gaussian.""" - result = scipy.ndimage.filters.correlate1d( + result = scipy.ndimage.correlate1d( image, gaussian_kernel_1d, axis=0) - result = scipy.ndimage.filters.correlate1d( + return scipy.ndimage.correlate1d( result, gaussian_kernel_1d, axis=1) - return result + def get_gaussian_kernel(gaussian_kernel_width=11, gaussian_kernel_sigma=1.5): """Generate a gaussian kernel.""" # 1D Gaussian kernel definition - gaussian_kernel_1d = numpy.ndarray((gaussian_kernel_width)) - norm_mu = int(gaussian_kernel_width / 2) + gaussian_kernel_1d = np.arange(0, gaussian_kernel_width, 1.) + gaussian_kernel_1d -= gaussian_kernel_width / 2 + gaussian_kernel_1d = np.exp(-0.5 * gaussian_kernel_1d**2 / + gaussian_kernel_sigma**2) + return gaussian_kernel_1d / np.sum(gaussian_kernel_1d) - # Fill Gaussian kernel - for i in range(gaussian_kernel_width): - gaussian_kernel_1d[i] = (exp(-(((i - norm_mu) ** 2)) / - (2 * (gaussian_kernel_sigma ** 2)))) - return gaussian_kernel_1d / numpy.sum(gaussian_kernel_1d) def to_grayscale(img): """Convert PIL image to numpy grayscale array and numpy alpha array. @@ -37,11 +35,11 @@ Returns: (gray, alpha): both numpy arrays. """ - gray = numpy.asarray(ImageOps.grayscale(img)).astype(numpy.float) + gray = np.asarray(ImageOps.grayscale(img)).astype(float) imbands = img.getbands() alpha = None if 'A' in imbands: - alpha = numpy.asarray(img.split()[-1]).astype(numpy.float) + alpha = np.asarray(img.split()[-1]).astype(float) return gray, alpha