Hello community, here is the log from the commit of package python3-imagesize for openSUSE:Factory checked in at 2016-05-17 17:10:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-imagesize (Old) and /work/SRC/openSUSE:Factory/.python3-imagesize.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-imagesize" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-imagesize/python3-imagesize.changes 2016-04-22 16:23:34.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3-imagesize.new/python3-imagesize.changes 2016-05-17 17:10:17.000000000 +0200 @@ -1,0 +2,12 @@ +Sun May 8 07:17:51 UTC 2016 - [email protected] + +- specfile: + * updated source url to files.pythonhosted.org + + +------------------------------------------------------------------- +Sun Apr 24 14:09:50 UTC 2016 - [email protected] + +- update to version 0.7.1: + +------------------------------------------------------------------- Old: ---- imagesize-0.7.0.tar.gz New: ---- imagesize-0.7.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-imagesize.spec ++++++ --- /var/tmp/diff_new_pack.70GkRx/_old 2016-05-17 17:10:18.000000000 +0200 +++ /var/tmp/diff_new_pack.70GkRx/_new 2016-05-17 17:10:18.000000000 +0200 @@ -17,13 +17,13 @@ Name: python3-imagesize -Version: 0.7.0 +Version: 0.7.1 Release: 0 Summary: Getting image size from png/jpeg/jpeg2000/gif file License: MIT Group: Development/Languages/Python Url: https://github.com/shibukawa/imagesize_py -Source: https://pypi.python.org/packages/source/i/imagesize/imagesize-%{version}.tar.gz +Source: https://files.pythonhosted.org/packages/source/i/imagesize/imagesize-%{version}.tar.gz BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ imagesize-0.7.0.tar.gz -> imagesize-0.7.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagesize-0.7.0/PKG-INFO new/imagesize-0.7.1/PKG-INFO --- old/imagesize-0.7.0/PKG-INFO 2016-02-08 17:25:00.000000000 +0100 +++ new/imagesize-0.7.1/PKG-INFO 2016-04-23 03:43:56.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: imagesize -Version: 0.7.0 +Version: 0.7.1 Summary: Getting image size from png/jpeg/jpeg2000/gif file Home-page: https://github.com/shibukawa/imagesize_py Author: Yoshiki Shibukawa diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagesize-0.7.0/README.rst new/imagesize-0.7.1/README.rst --- old/imagesize-0.7.0/README.rst 2016-02-02 08:55:23.000000000 +0100 +++ new/imagesize-0.7.1/README.rst 2016-04-23 03:34:34.000000000 +0200 @@ -1,6 +1,9 @@ imagesize ============= +.. image:: https://travis-ci.org/shibukawa/imagesize_py.svg?branch=master + :target: https://travis-ci.org/shibukawa/imagesize_py + This module analyzes jpeg/jpeg2000/png/gif image header and return image size. .. code:: python @@ -48,3 +51,11 @@ * http://markasread.net/post/17551554979/get-image-size-info-using-pure-python-code * http://stackoverflow.com/questions/8032642/how-to-obtain-image-size-using-standard-python-class-without-using-external-lib + +Thank you for feedbacks: + +* tk0miya (https://github.com/tk0miya) +* shimizukawa (https://github.com/shimizukawa) +* xantares (https://github.com/xantares) +* Ivan Zakharyaschev (https://github.com/imz) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagesize-0.7.0/imagesize/__init__.py new/imagesize-0.7.1/imagesize/__init__.py --- old/imagesize-0.7.0/imagesize/__init__.py 2016-02-02 06:38:24.000000000 +0100 +++ new/imagesize-0.7.1/imagesize/__init__.py 2016-04-23 03:38:44.000000000 +0200 @@ -2,8 +2,6 @@ __all__ = ("get",) -if sys.version_info[0] > 2: - from .py3 import get -else: - from py2 import get + +from .get import get diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagesize-0.7.0/imagesize/get.py new/imagesize-0.7.1/imagesize/get.py --- old/imagesize-0.7.0/imagesize/get.py 1970-01-01 01:00:00.000000000 +0100 +++ new/imagesize-0.7.1/imagesize/get.py 2016-04-23 03:38:44.000000000 +0200 @@ -0,0 +1,60 @@ +import struct + +def get(filepath): + """ + Return (width, height) for a given img file content + no requirements + """ + height = -1 + width = -1 + + with open(filepath, 'rb') as fhandle: + head = fhandle.read(24) + size = len(head) + # handle GIFs + if size >= 10 and head[:6] in (b'GIF87a', b'GIF89a'): + # Check to see if content_type is correct + try: + width, height = struct.unpack("<hh", head[6:10]) + except struct.error: + raise ValueError("Invalid GIF file") + # see png edition spec bytes are below chunk length then and finally the + elif size >= 24 and head.startswith(b'\211PNG\r\n\032\n') and head[12:16] == b'IHDR': + try: + width, height = struct.unpack(">LL", head[16:24]) + except struct.error: + raise ValueError("Invalid PNG file") + # Maybe this is for an older PNG version. + elif size >= 16 and head.startswith(b'\211PNG\r\n\032\n'): + # Check to see if we have the right content type + try: + width, height = struct.unpack(">LL", head[8:16]) + except struct.error: + raise ValueError("Invalid PNG file") + # handle JPEGs + elif size >= 2 and head.startswith(b'\377\330'): + try: + fhandle.seek(0) # Read 0xff next + size = 2 + ftype = 0 + while not 0xc0 <= ftype <= 0xcf: + fhandle.seek(size, 1) + byte = fhandle.read(1) + while ord(byte) == 0xff: + byte = fhandle.read(1) + ftype = ord(byte) + size = struct.unpack('>H', fhandle.read(2))[0] - 2 + # We are at a SOFn block + fhandle.seek(1, 1) # Skip `precision' byte. + height, width = struct.unpack('>HH', fhandle.read(4)) + except struct.error: + raise ValueError("Invalid JPEG file") + # handle JPEG2000s + elif size >= 12 and head.startswith(b'\x00\x00\x00\x0cjP \r\n\x87\n'): + fhandle.seek(48) + try: + height, width = struct.unpack('>LL', fhandle.read(8)) + except struct.error: + raise ValueError("Invalid JPEG2000 file") + return width, height + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagesize-0.7.0/imagesize/py2.py new/imagesize-0.7.1/imagesize/py2.py --- old/imagesize-0.7.0/imagesize/py2.py 2016-02-08 16:59:43.000000000 +0100 +++ new/imagesize-0.7.1/imagesize/py2.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,60 +0,0 @@ -import struct - -def get(filepath): - """ - Return (width, height) for a given img file content - no requirements - """ - height = -1 - width = -1 - - with open(filepath, 'rb') as fhandle: - head = fhandle.read(24) - size = len(head) - # handle GIFs - if size >= 10 and head[:6] in ('GIF87a', 'GIF89a'): - # Check to see if content_type is correct - try: - width, height = struct.unpack("<hh", head[6:10]) - except struct.error: - raise ValueError("Invalid GIF file") - # see png edition spec bytes are below chunk length then and finally the - elif size >= 24 and head.startswith('\211PNG\r\n\032\n') and head[12:16] == 'IHDR': - try: - width, height = struct.unpack(">LL", head[16:24]) - except struct.error: - raise ValueError("Invalid PNG file") - # Maybe this is for an older PNG version. - elif size >= 16 and head.startswith('\211PNG\r\n\032\n'): - # Check to see if we have the right content type - try: - width, height = struct.unpack(">LL", head[8:16]) - except struct.error: - raise ValueError("Invalid PNG file") - # handle JPEGs - elif size >= 2 and head.startswith('\377\330'): - try: - fhandle.seek(0) # Read 0xff next - size = 2 - ftype = 0 - while not 0xc0 <= ftype <= 0xcf: - fhandle.seek(size, 1) - byte = fhandle.read(1) - while ord(byte) == 0xff: - byte = fhandle.read(1) - ftype = ord(byte) - size = struct.unpack('>H', fhandle.read(2))[0] - 2 - # We are at a SOFn block - fhandle.seek(1, 1) # Skip `precision' byte. - height, width = struct.unpack('>HH', fhandle.read(4)) - except struct.error: - raise ValueError("Invalid JPEG file") - # handle JPEG2000s - elif size >= 12 and head.startswith('\x00\x00\x00\x0cjP \r\n\x87\n'): - fhandle.seek(48) - try: - height, width = struct.unpack('>LL', fhandle.read(8)) - except struct.error: - raise ValueError("Invalid JPEG2000 file") - return width, height - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagesize-0.7.0/imagesize/py3.py new/imagesize-0.7.1/imagesize/py3.py --- old/imagesize-0.7.0/imagesize/py3.py 2016-02-08 16:59:41.000000000 +0100 +++ new/imagesize-0.7.1/imagesize/py3.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,60 +0,0 @@ -import struct - -def get(filepath): - """ - Return (width, height) for a given img file content - no requirements - """ - height = -1 - width = -1 - - with open(filepath, 'rb') as fhandle: - head = fhandle.read(24) - size = len(head) - # handle GIFs - if size >= 10 and head[:6] in (b'GIF87a', b'GIF89a'): - # Check to see if content_type is correct - try: - width, height = struct.unpack("<hh", head[6:10]) - except struct.error: - raise ValueError("Invalid GIF file") - # see png edition spec bytes are below chunk length then and finally the - elif size >= 24 and head.startswith(b'\211PNG\r\n\032\n') and head[12:16] == b'IHDR': - try: - width, height = struct.unpack(">LL", head[16:24]) - except struct.error: - raise ValueError("Invalid PNG file") - # Maybe this is for an older PNG version. - elif size >= 16 and head.startswith(b'\211PNG\r\n\032\n'): - # Check to see if we have the right content type - try: - width, height = struct.unpack(">LL", head[8:16]) - except struct.error: - raise ValueError("Invalid PNG file") - # handle JPEGs - elif size >= 2 and head.startswith(b'\377\330'): - try: - fhandle.seek(0) # Read 0xff next - size = 2 - ftype = 0 - while not 0xc0 <= ftype <= 0xcf: - fhandle.seek(size, 1) - byte = fhandle.read(1) - while ord(byte) == 0xff: - byte = fhandle.read(1) - ftype = ord(byte) - size = struct.unpack('>H', fhandle.read(2))[0] - 2 - # We are at a SOFn block - fhandle.seek(1, 1) # Skip `precision' byte. - height, width = struct.unpack('>HH', fhandle.read(4)) - except struct.error: - raise ValueError("Invalid JPEG file") - # handle JPEG2000s - elif size >= 12 and head.startswith(b'\x00\x00\x00\x0cjP \r\n\x87\n'): - fhandle.seek(48) - try: - height, width = struct.unpack('>LL', fhandle.read(8)) - except struct.error: - raise ValueError("Invalid JPEG2000 file") - return width, height - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagesize-0.7.0/imagesize.egg-info/PKG-INFO new/imagesize-0.7.1/imagesize.egg-info/PKG-INFO --- old/imagesize-0.7.0/imagesize.egg-info/PKG-INFO 2016-02-08 17:25:00.000000000 +0100 +++ new/imagesize-0.7.1/imagesize.egg-info/PKG-INFO 2016-04-23 03:43:56.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: imagesize -Version: 0.7.0 +Version: 0.7.1 Summary: Getting image size from png/jpeg/jpeg2000/gif file Home-page: https://github.com/shibukawa/imagesize_py Author: Yoshiki Shibukawa diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagesize-0.7.0/imagesize.egg-info/SOURCES.txt new/imagesize-0.7.1/imagesize.egg-info/SOURCES.txt --- old/imagesize-0.7.0/imagesize.egg-info/SOURCES.txt 2016-02-08 17:25:00.000000000 +0100 +++ new/imagesize-0.7.1/imagesize.egg-info/SOURCES.txt 2016-04-23 03:43:56.000000000 +0200 @@ -2,8 +2,7 @@ setup.cfg setup.py imagesize/__init__.py -imagesize/py2.py -imagesize/py3.py +imagesize/get.py imagesize.egg-info/PKG-INFO imagesize.egg-info/SOURCES.txt imagesize.egg-info/dependency_links.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imagesize-0.7.0/setup.py new/imagesize-0.7.1/setup.py --- old/imagesize-0.7.0/setup.py 2016-02-08 17:01:04.000000000 +0100 +++ new/imagesize-0.7.1/setup.py 2016-04-23 03:20:04.000000000 +0200 @@ -4,7 +4,7 @@ #from distutils.core import setup setup(name='imagesize', - version='0.7.0', + version='0.7.1', description='Getting image size from png/jpeg/jpeg2000/gif file', long_description=''' It parses image files' header and return image size.
