Accepting request 677999 from home:jayvdb:django
- Initial spec for v0.4, with Pillow-imports.patch to workaround problems caused by top level Image.py OBS-URL: https://build.opensuse.org/request/show/677999 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pyssim?expand=0&rev=1
This commit is contained in:
commit
ce558eb1c2
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
27
LICENSE.md
Normal file
27
LICENSE.md
Normal file
@ -0,0 +1,27 @@
|
||||
The MIT License (MIT)
|
||||
=====================
|
||||
|
||||
Copyright © `2011` `Antoine Vacavant`
|
||||
Copyright © `2012` `Christopher Godfrey`
|
||||
Copyright © `2012` `Jeff Terrace`
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the “Software”), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
21
Pillow-imports.patch
Normal file
21
Pillow-imports.patch
Normal file
@ -0,0 +1,21 @@
|
||||
--- pyssim-0.4/ssim/compat.py.orig 2019-02-21 11:51:21.441139164 +0700
|
||||
+++ pyssim-0.4/ssim/compat.py 2019-02-21 11:51:49.633337140 +0700
|
||||
@@ -11,14 +11,14 @@
|
||||
# pylint: disable=unused-import
|
||||
|
||||
try:
|
||||
- import Image
|
||||
-except ImportError:
|
||||
from PIL import Image
|
||||
+except ImportError:
|
||||
+ import Image
|
||||
|
||||
try:
|
||||
- import ImageOps
|
||||
-except ImportError:
|
||||
from PIL import ImageOps
|
||||
+except ImportError:
|
||||
+ import ImageOps
|
||||
|
||||
if sys.version_info[0] > 2:
|
||||
basestring = (str, bytes)
|
3
pyssim-0.4.tar.gz
Normal file
3
pyssim-0.4.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:52184c85e6ed0362a508617497c70251837ab38a62531793e3ea7eeaf7a2e150
|
||||
size 5222
|
5
python-pyssim.changes
Normal file
5
python-pyssim.changes
Normal file
@ -0,0 +1,5 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 21 04:28:04 AM UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||||
|
||||
- Initial spec for v0.4, with Pillow-imports.patch to workaround
|
||||
problems caused by top level Image.py
|
76
python-pyssim.spec
Normal file
76
python-pyssim.spec
Normal file
@ -0,0 +1,76 @@
|
||||
#
|
||||
# spec file for package python-pyssim
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# 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/
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-pyssim
|
||||
Version: 0.4
|
||||
Release: 0
|
||||
Summary: Structured Similarity Image Metric (SSIM)
|
||||
License: MIT
|
||||
Group: Development/Languages/Python
|
||||
URL: https://github.com/jterrace/pyssim
|
||||
Source: https://files.pythonhosted.org/packages/source/p/pyssim/pyssim-%{version}.tar.gz
|
||||
Source1: https://github.com/jterrace/pyssim/tree/master/test-images/#/test-images.tgz
|
||||
Source2: https://raw.githubusercontent.com/jterrace/pyssim/master/LICENSE.md
|
||||
Patch0: Pillow-imports.patch
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-Pillow
|
||||
Requires: python-numpy
|
||||
Requires: python-scipy
|
||||
BuildArch: noarch
|
||||
# SECTION test requirements
|
||||
BuildRequires: %{python_module Pillow}
|
||||
BuildRequires: %{python_module numpy}
|
||||
BuildRequires: %{python_module scipy}
|
||||
# /SECTION
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
Module for computing Structured Similarity Image Metric (SSIM) in Python.
|
||||
|
||||
%prep
|
||||
%setup -q -n pyssim-%{version}
|
||||
%patch0 -p1
|
||||
tar -xzf %{SOURCE1}
|
||||
cp %{SOURCE2} .
|
||||
|
||||
%build
|
||||
%python_build
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
%{python_expand # Tests extracted from .travis.yml
|
||||
$python -m ssim test-images/test1-1.png test-images/test1-1.png | grep 1
|
||||
$python -m ssim test-images/test1-1.png test-images/test1-2.png | grep 0.998
|
||||
$python -m ssim test-images/test1-1.png "test-images/*" | grep -E " 1| 0.998| 0.672| 0.648" | wc -l | grep 4
|
||||
$python -m ssim --cw --width 128 --height 128 test-images/test1-1.png test-images/test1-1.png | grep 1
|
||||
$python -m ssim --cw --width 128 --height 128 test-images/test3-orig.jpg test-images/test3-rot.jpg | grep 0.938
|
||||
}
|
||||
|
||||
%files %{python_files}
|
||||
%license LICENSE.md
|
||||
%doc README.md
|
||||
%python3_only %{_bindir}/pyssim
|
||||
%{python_sitelib}/*
|
||||
|
||||
%changelog
|
3
test-images.tgz
Normal file
3
test-images.tgz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:abb82f3ba58783f5535d1aae9a9dd01149f9263354e6b38bede16376c8fc2764
|
||||
size 1997535
|
Loading…
x
Reference in New Issue
Block a user