[Python-modules-commits] [python-pgmagick] 01/04: Import python-pgmagick_0.6.4.orig.tar.gz

Wolfgang Borgert debacle at moszumanska.debian.org
Sun Jan 22 14:22:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository python-pgmagick.

commit a8d535b2bcd66bbf87ad2e85dd523f2f7f1bd4a8
Author: W. Martin Borgert <debacle at debian.org>
Date:   Sun Jan 22 13:44:17 2017 +0000

    Import python-pgmagick_0.6.4.orig.tar.gz
---
 LICENSE                       |  2 +-
 PKG-INFO                      |  2 +-
 pgmagick.egg-info/PKG-INFO    |  2 +-
 pgmagick.egg-info/SOURCES.txt |  4 +++-
 pgmagick/__init__.py          |  5 ++++-
 pgmagick/_version.py          |  2 +-
 setup.cfg                     |  3 +++
 setup.py                      |  2 +-
 src/Makefile                  |  4 ++--
 src/_Pixels.cpp               |  7 +++++++
 src/_STL.cpp                  |  7 +++++++
 test/test_pgmagick_image.py   | 12 ++++++++++++
 test/test_pgmagick_pixel.py   |  6 ++++++
 13 files changed, 49 insertions(+), 9 deletions(-)

diff --git a/LICENSE b/LICENSE
index eb2326c..45ef07d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2010-2012 Hideo Hattori
+Copyright (c) 2010-2017 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 --git a/PKG-INFO b/PKG-INFO
index 9d75141..b54c272 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: pgmagick
-Version: 0.6.2
+Version: 0.6.4
 Summary: Yet Another Python wrapper for GraphicsMagick
 Home-page: https://github.com/hhatto/pgmagick
 Author: Hideo Hattori
diff --git a/pgmagick.egg-info/PKG-INFO b/pgmagick.egg-info/PKG-INFO
index 9d75141..b54c272 100644
--- a/pgmagick.egg-info/PKG-INFO
+++ b/pgmagick.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: pgmagick
-Version: 0.6.2
+Version: 0.6.4
 Summary: Yet Another Python wrapper for GraphicsMagick
 Home-page: https://github.com/hhatto/pgmagick
 Author: Hideo Hattori
diff --git a/pgmagick.egg-info/SOURCES.txt b/pgmagick.egg-info/SOURCES.txt
index 10169f3..a35371f 100644
--- a/pgmagick.egg-info/SOURCES.txt
+++ b/pgmagick.egg-info/SOURCES.txt
@@ -2,6 +2,7 @@ LICENSE
 MANIFEST.in
 Makefile
 README.rst
+setup.cfg
 setup.py
 ./src/_Blob.cpp
 ./src/_ChannelType.cpp
@@ -128,4 +129,5 @@ test/test_pgmagick_geometry.py
 test/test_pgmagick_image.py
 test/test_pgmagick_imagelist.py
 test/test_pgmagick_libinfo.py
-test/test_pgmagick_montage.py
\ No newline at end of file
+test/test_pgmagick_montage.py
+test/test_pgmagick_pixel.py
\ No newline at end of file
diff --git a/pgmagick/__init__.py b/pgmagick/__init__.py
index 574d9b8..4ad5390 100644
--- a/pgmagick/__init__.py
+++ b/pgmagick/__init__.py
@@ -9,7 +9,7 @@ __init()
 class Blob(_pgmagick.Blob):
 
     def __init__(self, *args):
-        if len(args) == 1 and isinstance(args[0], str):
+        if len(args) == 1 and isinstance(args[0], (str, bytes)):
             _pgmagick.Blob.__init__(self)
             self.update(args[0])
         else:
@@ -407,6 +407,9 @@ class PathSmoothQuadraticCurvetoRel(_pgmagick.PathSmoothQuadraticCurvetoRel):
 class Pixels(_pgmagick.Pixels):
     pass
 
+class PixelPacket(_pgmagick.PixelPacket):
+    pass
+
 if hasattr(_pgmagick, "SparseColorMethod"):
     SparseColorMethod = _pgmagick.SparseColorMethod
 
diff --git a/pgmagick/_version.py b/pgmagick/_version.py
index aece342..02f8497 100644
--- a/pgmagick/_version.py
+++ b/pgmagick/_version.py
@@ -1 +1 @@
-__version__ = '0.6.2'
+__version__ = '0.6.4'
diff --git a/setup.cfg b/setup.cfg
index 861a9f5..6f08d0e 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,3 +1,6 @@
+[bdist_wheel]
+universal = 1
+
 [egg_info]
 tag_build = 
 tag_date = 0
diff --git a/setup.py b/setup.py
index 0534e7b..00a1bde 100644
--- a/setup.py
+++ b/setup.py
@@ -58,7 +58,7 @@ def get_version_from_pc(search_dirs, target):
         for root, dirs, files in os.walk(dirname):
             for f in files:
                 if f == target:
-                    _tmp = _grep("\Version: ", os.path.join(root, target))
+                    _tmp = _grep("Version: ", os.path.join(root, target))
                     return _tmp.split()[1]
 
 
diff --git a/src/Makefile b/src/Makefile
index d9d267d..f6ab568 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,6 +1,6 @@
-CC = g++
+CC = ccache clang
 FLAGS = -Wall
-INCS = -I/usr/include/python2.7 -I/usr/include/GraphicsMagick
+INCS = -I/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/include/GraphicsMagick
 SO = _pgmagick.so
 LIBS = -lboost_python -lGraphicsMagick++
 OBJS = _Blob.o \
diff --git a/src/_Pixels.cpp b/src/_Pixels.cpp
index 68525c3..f5b797b 100644
--- a/src/_Pixels.cpp
+++ b/src/_Pixels.cpp
@@ -15,4 +15,11 @@ void __Pixels()
         .def("columns", &Magick::Pixels::columns)
         .def("rows", &Magick::Pixels::rows)
     ;
+
+    class_< Magick::PixelPacket, boost::noncopyable >("PixelPacket", no_init)
+        .def_readwrite("red", &Magick::PixelPacket::red)
+        .def_readwrite("green", &Magick::PixelPacket::green)
+        .def_readwrite("blue", &Magick::PixelPacket::blue)
+        .def_readwrite("opacity", &Magick::PixelPacket::opacity)
+    ;
 }
diff --git a/src/_STL.cpp b/src/_STL.cpp
index c0cccae..08aee3c 100644
--- a/src/_STL.cpp
+++ b/src/_STL.cpp
@@ -23,6 +23,7 @@ public:
     void _append(Magick::Image);
     void _appendImages(Magick::Image*);
     void _coalesceImages(void);
+    void _flattenImages(Magick::Image*);
     void _readImages(const std::string&);
     void _readImages(Magick::Blob&);
     void _writeImages(const std::string&, bool);
@@ -80,6 +81,11 @@ void _ImageList::_coalesceImages(void)
     Magick::coalesceImages(&_images, _images.begin(), _images.end());
 }
 
+void _ImageList::_flattenImages(Magick::Image *_image)
+{
+    Magick::flattenImages(_image, _images.begin(), _images.end());
+}
+
 void _ImageList::_readImages(const std::string &imageSpec)
 {
     Magick::readImages(&_images, imageSpec);
@@ -118,6 +124,7 @@ void __STL()
         .def("append", (void (_ImageList::*)(Magick::Image))&_ImageList::_append)
         .def("appendImages", (void (_ImageList::*)(Magick::Image*))&_ImageList::_appendImages)
         .def("coalesceImags", (void (_ImageList::*)(void))&_ImageList::_coalesceImages)
+        .def("flattenImags", (void (_ImageList::*)(void))&_ImageList::_flattenImages)
         .def("readImages", (void (_ImageList::*)(const std::string&))&_ImageList::_readImages)
         .def("readImages", (void (_ImageList::*)(Magick::Blob&))&_ImageList::_readImages)
         .def("writeImages", (void (_ImageList::*)(const std::string&, bool))&_ImageList::_writeImages, Magick_ImageList__writeImages_overloads_1_2())
diff --git a/test/test_pgmagick_image.py b/test/test_pgmagick_image.py
index 5c562ad..7e06432 100644
--- a/test/test_pgmagick_image.py
+++ b/test/test_pgmagick_image.py
@@ -96,4 +96,16 @@ class TestIMImage(unittest.TestCase):
             self.assertEqual(type(ret),
                              type(pgmagick._pgmagick.VirtualPixelMethod()))
 
+
+class TestImageWithBlob(unittest.TestCase):
+
+    def test_fromblob(self):
+        with open('../example/X.jpg', 'rb') as f:
+            data = f.read()
+            b = Blob(data)
+            img = Image(b)
+            img.write('X2.jpg')
+            self.assertEqual(type(img), Image)
+
+
 unittest.main()
diff --git a/test/test_pgmagick_pixel.py b/test/test_pgmagick_pixel.py
new file mode 100644
index 0000000..b592cf3
--- /dev/null
+++ b/test/test_pgmagick_pixel.py
@@ -0,0 +1,6 @@
+import sys
+sys.path.append('../')
+sys.path.append('./')
+from pgmagick import Pixels
+from pgmagick import PixelPacket
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pgmagick.git



More information about the Python-modules-commits mailing list