Merge branch 'release-0.2.7'

This commit is contained in:
jevans 2013-07-25 19:19:16 -04:00
commit 30428f898d
12 changed files with 34 additions and 17 deletions

View file

@ -1,3 +1,6 @@
Jul 25, 2013 - v0.2.7 Warns but no longer errors out when neither library is
found (issue89).
Jul 24, 2013 - v0.2.6 No longer warning when configuration file not found. Jul 24, 2013 - v0.2.6 No longer warning when configuration file not found.
Added read support for jpch, jplh boxes. Added testing of files in Added read support for jpch, jplh boxes. Added testing of files in
format-corpus repository. format-corpus repository.

View file

@ -78,7 +78,7 @@ copyright = u'2013, John Evans'
# The short X.Y version. # The short X.Y version.
version = '0.2' version = '0.2'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.2.6' release = '0.2.7'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View file

@ -140,7 +140,6 @@ class Codestream(object):
fptr.seek(self._tile_offset[-1] + self._tile_length[-1]) fptr.seek(self._tile_offset[-1] + self._tile_length[-1])
def _process_marker_segment(self, fptr, marker_id): def _process_marker_segment(self, fptr, marker_id):
"""Process and return a segment from the codestream. """Process and return a segment from the codestream.
""" """
@ -207,7 +206,8 @@ class Codestream(object):
segment = _parse_sot_segment(fptr) segment = _parse_sot_segment(fptr)
self._tile_offset.append(segment.offset) self._tile_offset.append(segment.offset)
if segment.psot == 0: if segment.psot == 0:
tile_part_length = self.offset + self.length - segment.offset - 2 tile_part_length = (self.offset + self.length -
segment.offset - 2)
else: else:
tile_part_length = segment.psot tile_part_length = segment.psot
self._tile_length.append(tile_part_length) self._tile_length.append(tile_part_length)

View file

@ -178,7 +178,6 @@ class Jp2k(Jp2kBox):
msg += "profile if the file type box brand is 'jp2 '." msg += "profile if the file type box brand is 'jp2 '."
warnings.warn(msg) warnings.warn(msg)
# pylint: disable-msg=W0221 # pylint: disable-msg=W0221
def write(self, img_array, cratios=None, eph=False, psnr=None, numres=None, def write(self, img_array, cratios=None, eph=False, psnr=None, numres=None,
cbsize=None, psizes=None, grid_offset=None, sop=False, cbsize=None, psizes=None, grid_offset=None, sop=False,

View file

@ -1,4 +1,3 @@
"""This package organizes individual libraries employed by glymur.""" """This package organizes individual libraries employed by glymur."""
from . import openjp2 as _openjp2 from . import openjp2 as _openjp2
from . import openjpeg as _openjpeg from . import openjpeg as _openjpeg
#from . import test

View file

@ -58,6 +58,9 @@ def load_openjpeg(libopenjpeg_path):
'bin', 'openjpeg.dll') 'bin', 'openjpeg.dll')
if os.path.exists(path): if os.path.exists(path):
libopenjpeg_path = path libopenjpeg_path = path
else:
# No sense trying further on Linux
return None
try: try:
if os.name == "nt": if os.name == "nt":
@ -124,6 +127,10 @@ def glymur_config():
libs = read_config_file() libs = read_config_file()
libopenjp2_handle = load_openjp2(libs['openjp2']) libopenjp2_handle = load_openjp2(libs['openjp2'])
libopenjpeg_handle = load_openjpeg(libs['openjpeg']) libopenjpeg_handle = load_openjpeg(libs['openjpeg'])
if libopenjp2_handle is None and libopenjpeg_handle is None:
msg = "Neither the openjp2 nor the openjpeg library could be loaded. "
msg += "Operating in severely degraded mode."
warnings.warn(msg, UserWarning)
return libopenjp2_handle, libopenjpeg_handle return libopenjp2_handle, libopenjpeg_handle

View file

@ -22,8 +22,15 @@ def version():
return library_version return library_version
# Need to get the minor version, make sure we are at least at 1.4.x # Need to get the minor version, make sure we are at least at 1.4.x
#import pdb; pdb.set_trace() if OPENJPEG is not None:
_MINOR = version().split('.')[1] _MINOR = version().split('.')[1]
else:
# Does not really matter. But version should not be called if there is no
# OpenJPEG library found.
_MINOR = 0
# Redefine version so that we can use it.
def version():
return '0.0.0'
class EventMgrType(ctypes.Structure): class EventMgrType(ctypes.Structure):

View file

@ -47,6 +47,9 @@ def load_tests(loader, tests, ignore):
return tests return tests
@unittest.skipIf(glymur.lib.openjp2.OPENJP2 is None and
glymur.lib.openjpeg.OPENJPEG is None,
"Missing openjp2 library.")
class TestConfig(unittest.TestCase): class TestConfig(unittest.TestCase):
def setUp(self): def setUp(self):

View file

@ -832,7 +832,6 @@ class TestSuite(unittest.TestCase):
data = Jp2k(jfile).read() data = Jp2k(jfile).read()
self.assertTrue(True) self.assertTrue(True)
@unittest.skipIf(sys.hexversion < 0x03020000, @unittest.skipIf(sys.hexversion < 0x03020000,
"Uses features introduced in 3.2.") "Uses features introduced in 3.2.")
def test_NR_DEC_broken3_jp2_6_decode(self): def test_NR_DEC_broken3_jp2_6_decode(self):

View file

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
import sys import sys
kwargs = {'name': 'Glymur', kwargs = {'name': 'Glymur',
'version': '0.2.6', 'version': '0.2.7',
'description': 'Tools for accessing JPEG2000 files', 'description': 'Tools for accessing JPEG2000 files',
'long_description': open('README.md').read(), 'long_description': open('README.md').read(),
'author': 'John Evans', 'author': 'John Evans',