Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-pgmagick for openSUSE:Factory
checked in at 2023-12-28 23:02:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pgmagick (Old)
and /work/SRC/openSUSE:Factory/.python-pgmagick.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pgmagick"
Thu Dec 28 23:02:14 2023 rev:4 rq:1135324 version:0.7.6
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pgmagick/python-pgmagick.changes
2020-04-27 23:36:56.463354936 +0200
+++
/work/SRC/openSUSE:Factory/.python-pgmagick.new.28375/python-pgmagick.changes
2023-12-28 23:03:56.895891393 +0100
@@ -1,0 +2,17 @@
+Wed Dec 27 14:29:09 UTC 2023 - Dirk Müller <[email protected]>
+
+- update to 0.7.6:
+ * #70, #67 : Support M1 Mac
+- update to 0.7.5:
+ * #50 : Enable passing Py3 bytes as pixels for constructor with
+ StorageType
+ * #51 : Fix screwed parameters
+- update to 0.7.4:
+ * fix libboost_python filename for macOSX environment with
+ Homebrew. ( 8ad8f917e93ba66c49d01952ba5488cd473a4fc4 )
+ * `setup.py` now looks for `libboost_python2x`,
+ `libboost_python2x-mt`, `libboost_python3x` and
+ `libboost_python3x-mt` as well.
+- drop reproducible.patch (upstream)
+
+-------------------------------------------------------------------
Old:
----
pgmagick-0.7.4.tar.gz
reproducible.patch
New:
----
pgmagick-0.7.6.tar.gz
BETA DEBUG BEGIN:
Old: `libboost_python3x-mt` as well.
- drop reproducible.patch (upstream)
BETA DEBUG END:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pgmagick.spec ++++++
--- /var/tmp/diff_new_pack.FLTniz/_old 2023-12-28 23:03:57.647918878 +0100
+++ /var/tmp/diff_new_pack.FLTniz/_new 2023-12-28 23:03:57.647918878 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-pgmagick
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,18 +16,15 @@
#
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%bcond_without python2
+%{?sle15_python_module_pythons}
Name: python-pgmagick
-Version: 0.7.4
+Version: 0.7.6
Release: 0
Summary: Yet Another Python wrapper for GraphicsMagick
License: MIT
Group: Development/Languages/Python
URL: https://github.com/hhatto/pgmagick/
Source:
https://files.pythonhosted.org/packages/source/p/pgmagick/pgmagick-%{version}.tar.gz
-# PATCH-FIX-UPSTREAM https://github.com/hhatto/pgmagick/pull/47
-Patch0: reproducible.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@@ -50,8 +47,7 @@
wrapper for GraphicsMagick.
%prep
-%setup -q -n pgmagick-%{version}
-%patch0 -p1
+%autosetup -p1 -n pgmagick-%{version}
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
++++++ pgmagick-0.7.4.tar.gz -> pgmagick-0.7.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/LICENSE new/pgmagick-0.7.6/LICENSE
--- old/pgmagick-0.7.4/LICENSE 2017-02-06 19:13:36.000000000 +0100
+++ new/pgmagick-0.7.6/LICENSE 2019-10-31 14:23:42.000000000 +0100
@@ -1,4 +1,4 @@
-Copyright (c) 2010-2017 Hideo Hattori
+Copyright (c) 2010-2018 Hideo Hattori
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/Makefile new/pgmagick-0.7.6/Makefile
--- old/pgmagick-0.7.4/Makefile 2017-11-20 15:36:02.000000000 +0100
+++ new/pgmagick-0.7.6/Makefile 2019-10-31 14:23:42.000000000 +0100
@@ -31,9 +31,9 @@
build_bdist_wheel:
# NOTE: only available in my environment
- sh ~/.virtualenvs/py363/bin/activate
+ workon py363
python setup.py bdist_wheel
- sh ~/.virtualenvs/py2714/bin/activate
+ workon py2714
pip install --upgrade pip
python setup.py bdist_wheel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/PKG-INFO new/pgmagick-0.7.6/PKG-INFO
--- old/pgmagick-0.7.4/PKG-INFO 2018-04-30 17:56:25.000000000 +0200
+++ new/pgmagick-0.7.6/PKG-INFO 2021-04-21 17:31:39.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pgmagick
-Version: 0.7.4
+Version: 0.7.6
Summary: Yet Another Python wrapper for GraphicsMagick
Home-page: https://github.com/hhatto/pgmagick
Author: Hideo Hattori
@@ -9,12 +9,17 @@
Description: About
=====
- .. image:: https://travis-ci.org/hhatto/pgmagick.svg?branch=master
- :target: https://travis-ci.org/hhatto/pgmagick
+ .. image:: https://img.shields.io/pypi/v/pgmagick.svg
+ :target: https://pypi.org/project/pgmagick/
+ :alt: PyPI Version
+
+ .. image::
https://github.com/hhatto/pgmagick/workflows/Python%20package/badge.svg
+ :target: https://github.com/hhatto/pgmagick/actions
:alt: Build status
- pgmagick is a yet another boost.python based wrapper for
GraphicsMagick.
+ pgmagick is a yet another boost.python based wrapper for
GraphicsMagick_ .
+ .. _GraphicsMagick: http://www.graphicsmagick.org/
Installation
============
@@ -25,7 +30,11 @@
Requirements
============
- Python2.5++, GraphicsMagick and Boost.Python.
+ Python3.5++ (or Python2.7), GraphicsMagick and Boost.Python.
+
+ package install on Debian Buster::
+
+ $ apt-get install g++ libgraphicsmagick++1-dev libboost-python-dev
package install on Ubuntu(test on Ubuntu10.04+)::
@@ -49,7 +58,7 @@
MacOSX
------
- via homebrew-cask(homebrew-pgmagick) with Python2
+ via homebrew-cask(homebrew-pgmagick) with Python3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
use `homebrew-pgmagick`_ ::
@@ -59,35 +68,16 @@
.. _`homebrew-pgmagick`: https://github.com/hhatto/homebrew-pgmagick
via homebrew-cask(homebrew-pgmagick) with Python3
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- with `--with-python3` option::
-
- $ brew install pgmagick --with-python3
via homebrew and pip with Python3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- on MacOSX 10.11.6::
-
- $ brew install graphicsmagick
- $ brew install boost-python --with-python3
- $ pip install pgmagick
-
- via homebrew and pip with Python2
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *update 2017.05.17*
- on MacOSX 10.11.6::
+ on MacOSX (10.13.5~10.15.x)::
+ $ brew install python
$ brew install graphicsmagick
- $ brew install boost-python
+ $ brew install boost-python3
$ pip install pgmagick
- *update 2014.05.12*
- on MacOSX 10.9.2 (add ARCHFLAGS)::
-
- $ brew install graphicsmagick
- $ brew install boost --with-python
- $
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip
install pgmagick
-
Windows
-------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/README.rst
new/pgmagick-0.7.6/README.rst
--- old/pgmagick-0.7.4/README.rst 2017-05-27 10:28:03.000000000 +0200
+++ new/pgmagick-0.7.6/README.rst 2021-01-03 03:38:46.000000000 +0100
@@ -1,12 +1,17 @@
About
=====
-.. image:: https://travis-ci.org/hhatto/pgmagick.svg?branch=master
- :target: https://travis-ci.org/hhatto/pgmagick
+.. image:: https://img.shields.io/pypi/v/pgmagick.svg
+ :target: https://pypi.org/project/pgmagick/
+ :alt: PyPI Version
+
+.. image::
https://github.com/hhatto/pgmagick/workflows/Python%20package/badge.svg
+ :target: https://github.com/hhatto/pgmagick/actions
:alt: Build status
-pgmagick is a yet another boost.python based wrapper for GraphicsMagick.
+pgmagick is a yet another boost.python based wrapper for GraphicsMagick_ .
+.. _GraphicsMagick: http://www.graphicsmagick.org/
Installation
============
@@ -17,7 +22,11 @@
Requirements
============
-Python2.5++, GraphicsMagick and Boost.Python.
+Python3.5++ (or Python2.7), GraphicsMagick and Boost.Python.
+
+package install on Debian Buster::
+
+ $ apt-get install g++ libgraphicsmagick++1-dev libboost-python-dev
package install on Ubuntu(test on Ubuntu10.04+)::
@@ -41,7 +50,7 @@
MacOSX
------
-via homebrew-cask(homebrew-pgmagick) with Python2
+via homebrew-cask(homebrew-pgmagick) with Python3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
use `homebrew-pgmagick`_ ::
@@ -51,35 +60,16 @@
.. _`homebrew-pgmagick`: https://github.com/hhatto/homebrew-pgmagick
via homebrew-cask(homebrew-pgmagick) with Python3
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-with `--with-python3` option::
-
- $ brew install pgmagick --with-python3
via homebrew and pip with Python3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-on MacOSX 10.11.6::
-
- $ brew install graphicsmagick
- $ brew install boost-python --with-python3
- $ pip install pgmagick
-
-via homebrew and pip with Python2
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-*update 2017.05.17*
-on MacOSX 10.11.6::
+on MacOSX (10.13.5~10.15.x)::
+ $ brew install python
$ brew install graphicsmagick
- $ brew install boost-python
+ $ brew install boost-python3
$ pip install pgmagick
-*update 2014.05.12*
-on MacOSX 10.9.2 (add ARCHFLAGS)::
-
- $ brew install graphicsmagick
- $ brew install boost --with-python
- $ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
pip install pgmagick
-
Windows
-------
Binary files old/pgmagick-0.7.4/example/output.jpg and
new/pgmagick-0.7.6/example/output.jpg differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/pgmagick/_version.py
new/pgmagick-0.7.6/pgmagick/_version.py
--- old/pgmagick-0.7.4/pgmagick/_version.py 2018-04-30 17:52:52.000000000
+0200
+++ new/pgmagick-0.7.6/pgmagick/_version.py 2021-04-21 17:28:31.000000000
+0200
@@ -1 +1 @@
-__version__ = '0.7.4'
+__version__ = '0.7.6'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/pgmagick/api.py
new/pgmagick-0.7.6/pgmagick/api.py
--- old/pgmagick-0.7.4/pgmagick/api.py 2017-11-20 15:31:25.000000000 +0100
+++ new/pgmagick-0.7.6/pgmagick/api.py 2021-02-13 03:37:46.000000000 +0100
@@ -656,7 +656,7 @@
if len(geometry) == 4:
width, height = geometry[0], geometry[1]
x, y = geometry[2], geometry[3]
- g = pgmagick.Geometry(x, y, width, height)
+ g = pgmagick.Geometry(width, height, x, y)
elif len(geometry) == 1 and isinstance(geometry[0], pgmagick.Geometry):
g = geometry[0]
else:
@@ -847,7 +847,7 @@
else:
stretch = "%sStretch" % stretch.title()
stretch = getattr(pgmagick.StretchType, "%s" % stretch)
- if weight is 'bold':
+ if weight == 'bold':
weight = 800
font = pgmagick.DrawableFont(family, style, weight, stretch)
self.drawer.append(font)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/pgmagick.egg-info/PKG-INFO
new/pgmagick-0.7.6/pgmagick.egg-info/PKG-INFO
--- old/pgmagick-0.7.4/pgmagick.egg-info/PKG-INFO 2018-04-30
17:56:25.000000000 +0200
+++ new/pgmagick-0.7.6/pgmagick.egg-info/PKG-INFO 2021-04-21
17:31:39.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pgmagick
-Version: 0.7.4
+Version: 0.7.6
Summary: Yet Another Python wrapper for GraphicsMagick
Home-page: https://github.com/hhatto/pgmagick
Author: Hideo Hattori
@@ -9,12 +9,17 @@
Description: About
=====
- .. image:: https://travis-ci.org/hhatto/pgmagick.svg?branch=master
- :target: https://travis-ci.org/hhatto/pgmagick
+ .. image:: https://img.shields.io/pypi/v/pgmagick.svg
+ :target: https://pypi.org/project/pgmagick/
+ :alt: PyPI Version
+
+ .. image::
https://github.com/hhatto/pgmagick/workflows/Python%20package/badge.svg
+ :target: https://github.com/hhatto/pgmagick/actions
:alt: Build status
- pgmagick is a yet another boost.python based wrapper for
GraphicsMagick.
+ pgmagick is a yet another boost.python based wrapper for
GraphicsMagick_ .
+ .. _GraphicsMagick: http://www.graphicsmagick.org/
Installation
============
@@ -25,7 +30,11 @@
Requirements
============
- Python2.5++, GraphicsMagick and Boost.Python.
+ Python3.5++ (or Python2.7), GraphicsMagick and Boost.Python.
+
+ package install on Debian Buster::
+
+ $ apt-get install g++ libgraphicsmagick++1-dev libboost-python-dev
package install on Ubuntu(test on Ubuntu10.04+)::
@@ -49,7 +58,7 @@
MacOSX
------
- via homebrew-cask(homebrew-pgmagick) with Python2
+ via homebrew-cask(homebrew-pgmagick) with Python3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
use `homebrew-pgmagick`_ ::
@@ -59,35 +68,16 @@
.. _`homebrew-pgmagick`: https://github.com/hhatto/homebrew-pgmagick
via homebrew-cask(homebrew-pgmagick) with Python3
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- with `--with-python3` option::
-
- $ brew install pgmagick --with-python3
via homebrew and pip with Python3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- on MacOSX 10.11.6::
-
- $ brew install graphicsmagick
- $ brew install boost-python --with-python3
- $ pip install pgmagick
-
- via homebrew and pip with Python2
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *update 2017.05.17*
- on MacOSX 10.11.6::
+ on MacOSX (10.13.5~10.15.x)::
+ $ brew install python
$ brew install graphicsmagick
- $ brew install boost-python
+ $ brew install boost-python3
$ pip install pgmagick
- *update 2014.05.12*
- on MacOSX 10.9.2 (add ARCHFLAGS)::
-
- $ brew install graphicsmagick
- $ brew install boost --with-python
- $
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip
install pgmagick
-
Windows
-------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/pgmagick.egg-info/SOURCES.txt
new/pgmagick-0.7.6/pgmagick.egg-info/SOURCES.txt
--- old/pgmagick-0.7.4/pgmagick.egg-info/SOURCES.txt 2018-04-30
17:56:25.000000000 +0200
+++ new/pgmagick-0.7.6/pgmagick.egg-info/SOURCES.txt 2021-04-21
17:31:39.000000000 +0200
@@ -124,7 +124,6 @@
example/im.sh
example/image_from_storage.py
example/imagelist.py
-example/output.jpg
example/pgmagick_prof.py
example/pixels.py
example/profile.sh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/setup.py new/pgmagick-0.7.6/setup.py
--- old/pgmagick-0.7.4/setup.py 2018-04-29 18:14:25.000000000 +0200
+++ new/pgmagick-0.7.6/setup.py 2021-04-21 17:28:18.000000000 +0200
@@ -27,8 +27,13 @@
'/usr/include/GraphicsMagick/']
search_library_dirs = ['/usr/local/lib64/', '/usr/lib64/',
'/usr/local/lib/', '/usr/lib/']
-search_pkgconfig_dirs = ['/usr/local/lib/pkgconfig/',
'/usr/local/lib64/pkgconfig/',
- '/usr/lib/pkgconfig/', '/usr/lib64/pkgconfig']
+search_pkgconfig_dirs = [
+ '/opt/homebrew/lib/pkgconfig',
+ '/usr/local/lib/pkgconfig/',
+ '/usr/local/lib64/pkgconfig/',
+ '/usr/lib/pkgconfig/',
+ '/usr/lib64/pkgconfig',
+]
if sys.platform.lower() == 'darwin':
if os.path.exists('/opt/local/include'):
include_dirs.append('/opt/local/include/')
@@ -36,8 +41,10 @@
include_dirs.append('/usr/local/include/')
search_include_dirs.extend(['/opt/local/include/GraphicsMagick/',
'/opt/local/include/',
+ '/opt/homebrew/include/GraphicsMagick',
'/usr/local/Cellar/graphicsmagick'])
search_library_dirs.extend(['/opt/local/lib/',
+ '/opt/homebrew/lib',
'/usr/local/Cellar/graphicsmagick'])
# for ImageMagick
search_include_dirs.extend(['/usr/local/include/ImageMagick/',
@@ -218,7 +225,7 @@
packages=find_packages(),
ext_modules=[
Extension('pgmagick._pgmagick',
- sources=glob.glob('./src/*.cpp'),
+ sources=sorted(glob.glob('./src/*.cpp')),
include_dirs=include_dirs,
library_dirs=library_dirs,
libraries=libraries,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/src/Makefile
new/pgmagick-0.7.6/src/Makefile
--- old/pgmagick-0.7.4/src/Makefile 2017-06-07 19:12:04.000000000 +0200
+++ new/pgmagick-0.7.6/src/Makefile 2019-10-31 14:23:42.000000000 +0100
@@ -1,10 +1,10 @@
-CC = ccache clang++
-FLAGS = -Wall -DPGMAGICK_LIB_GRAPHICSMAGICK_1_3_24
-DPGMAGICK_LIB_GRAPHICSMAGICK_1_3_22
-INCS = -I/usr/include/python2.7 -I/usr/local/include/GraphicsMagick
+CC = g++
+FLAGS = -Wall
+INCS = -I/usr/include/python2.7 -I/usr/include/GraphicsMagick
SO = _pgmagick.so
LIBS = -lboost_python -lGraphicsMagick++
-#LINK_FLAGS = -fPIC -shared
-LINK_FLAGS = -bundle -undefined dynamic_lookup # for macOS
+LINK_FLAGS = -fPIC -shared
+#LINK_FLAGS = -bundle -undefined dynamic_lookup # for macOS
OBJS = _Blob.o \
_ChannelType.o \
_Color.o \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/src/_Image.cpp
new/pgmagick-0.7.6/src/_Image.cpp
--- old/pgmagick-0.7.4/src/_Image.cpp 2018-04-29 16:21:58.000000000 +0200
+++ new/pgmagick-0.7.6/src/_Image.cpp 2019-10-31 14:23:42.000000000 +0100
@@ -66,6 +66,15 @@
return histogram;
}
+#if PY_MAJOR_VERSION >= 3
+// enable passing bytes as pixels, they aren't autoconverted bytes -> const
char/void*
+static boost::shared_ptr<Magick::Image> initImageFromStorage(const unsigned
int width, const unsigned int height, const std::string& map,
+ const
Magick::StorageType type, const std::string& pixels)
+{
+ return boost::shared_ptr<Magick::Image>(new Magick::Image(width, height,
map, type, pixels.c_str()));
+}
+#endif
+
void __Image()
{
def("InitializeMagick", Magick::InitializeMagick);
@@ -91,6 +100,9 @@
.def(init< const size_t, const size_t, const std::string&, const
Magick::StorageType, const char* >())
#else
.def(init< const unsigned int, const unsigned int, const std::string&,
const Magick::StorageType, const char* >())
+ #if PY_MAJOR_VERSION >= 3
+ .def("__init__", make_constructor(initImageFromStorage))
+ #endif
#endif
.def(init< const Magick::Image& >())
#ifdef PGMAGICK_LIB_IMAGEMAGICK
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/test/test_cookbook.py
new/pgmagick-0.7.6/test/test_cookbook.py
--- old/pgmagick-0.7.4/test/test_cookbook.py 2018-04-29 16:21:58.000000000
+0200
+++ new/pgmagick-0.7.6/test/test_cookbook.py 2021-01-02 17:15:49.000000000
+0100
@@ -5,6 +5,8 @@
from pgmagick import api
from pgmagick import Image, Geometry, Blob
+from utils import MACOSX_FONT
+
class TestCookbook(unittest.TestCase):
@@ -33,21 +35,21 @@
def test_annotate(self):
img = api.Image((300, 200))
if sys.platform.lower() == 'darwin':
- img.font("/Library/Fonts/Arial.ttf")
+ img.font(MACOSX_FONT)
img.annotate('Hello World')
img.write(self.tmp_filename_png)
def test_annotate_with_angle45(self):
img = api.Image((300, 200))
if sys.platform.lower() == 'darwin':
- img.font("/Library/Fonts/Arial.ttf")
+ img.font(MACOSX_FONT)
img.annotate('Hello World', angle=45)
img.write(self.tmp_filename_png)
def test_annotate_with_japanese_font(self):
img = api.Image((300, 200))
if sys.platform.lower() == 'darwin':
- img.font("/System/Library/Fonts/Hiragino Sans GB W3.ttc")
+ img.font("/System/Library/Fonts/Hiragino Sans GB.ttc")
else:
# TODO: not support windows
img.font("/usr/share/fonts/truetype/ttf-japanese-gothic.ttf")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/test/test_pgmagick_api.py
new/pgmagick-0.7.6/test/test_pgmagick_api.py
--- old/pgmagick-0.7.4/test/test_pgmagick_api.py 2017-11-20
15:31:25.000000000 +0100
+++ new/pgmagick-0.7.6/test/test_pgmagick_api.py 2021-01-02
17:15:49.000000000 +0100
@@ -6,6 +6,8 @@
import pgmagick
from pgmagick.api import Image, Draw
+from utils import MACOSX_FONT
+
print(pgmagick.gminfo().version)
LIBGM_VERSION = [int(v) for v in pgmagick.gminfo().version.split('.')]
@@ -45,29 +47,25 @@
img.write('t.jpg')
def test_scale_with_filtertype(self):
- img = Image((600, 400), 'gradient:#ffffff-#000000')
- img.scale(0.6, 'Catrom')
- img.write('t.jpg')
- m = hashlib.md5()
- with open('t.jpg', 'rb') as fp:
- m.update(fp.read())
- scale_with_filtertype_catrom_digest = m.hexdigest()
- img = Image((600, 400), 'gradient:#ffffff-#000000')
- img.scale(0.6, 'Cubic')
- img.write('t.jpg')
- m = hashlib.md5()
- with open('t.jpg', 'rb') as fp:
- m.update(fp.read())
- scale_with_filtertype_cubic_digest = m.hexdigest()
- img = Image((600, 400), 'gradient:#ffffff-#000000')
- img.scale(0.6)
- img.write('t.jpg')
- m = hashlib.md5()
- with open('t.jpg', 'rb') as fp:
- m.update(fp.read())
- scale_digest = m.hexdigest()
- self.assertNotEqual(scale_with_filtertype_catrom_digest, scale_digest)
- self.assertNotEqual(scale_with_filtertype_catrom_digest,
scale_with_filtertype_cubic_digest)
+ testset = {"Catrom": None, "Cubic": None, "None": None}
+ for k, v in testset.items():
+ img = Image((600, 400), 'gradient:#ffffff-#000000')
+ if sys.platform.lower() == 'darwin':
+ img.font(MACOSX_FONT)
+ img.annotate("hello", (100, 100))
+ if k != "None":
+ img.scale(0.6, k)
+ else:
+ img.scale(0.6)
+ img.write('t.jpg')
+ m = hashlib.md5()
+ with open('t.jpg', 'rb') as fp:
+ m.update(fp.read())
+ testset[k] = m.hexdigest()
+
+ self.assertNotEqual(testset["Catrom"], testset["None"])
+ self.assertNotEqual(testset["Cubic"], testset["None"])
+ self.assertNotEqual(testset["Catrom"], testset["Cubic"])
def test_composite_arg_list(self):
base = Image((300, 200), 'green')
@@ -98,7 +96,7 @@
self.assertEqual(60, img.font_pointsize())
self.assertEqual(float, type(img.font_pointsize()))
if sys.platform.lower() == 'darwin':
- img.font("/Library/Fonts/Arial.ttf")
+ img.font(MACOSX_FONT)
img.annotate("hello", (100, 100))
img.write('t.png')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pgmagick-0.7.4/test/test_pgmagick_image.py
new/pgmagick-0.7.6/test/test_pgmagick_image.py
--- old/pgmagick-0.7.4/test/test_pgmagick_image.py 2018-04-29
16:21:58.000000000 +0200
+++ new/pgmagick-0.7.6/test/test_pgmagick_image.py 2019-10-31
14:23:42.000000000 +0100
@@ -72,6 +72,12 @@
img = Image(100, 100, "RGB", StorageType.CharPixel, "".join(data))
del(img)
+ def test_image_init_RGBA_XWD_header(self):
+ data = b"\0\0\0\0\4\0\0\0" + 92 * b"\0"
+ img = Image(5, 5, "RGBA", StorageType.CharPixel, data)
+ self.assertEqual(5, img.size().height())
+ self.assertEqual(5, img.size().width())
+
@unittest.skip("do not know how to use haldClut method")
def test_haldClut(self):
img = Image()