Skip to content

Commit

Permalink
remove openjpeg binary/lib, and use the packaged libopenjp2-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
bcail committed Jan 23, 2019
1 parent 75eff75 commit b147c89
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 21 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -11,6 +11,7 @@ addons:
- liblcms2-2
- liblcms2-dev
- liblcms2-utils
- libopenjp2-tools
- libtiff5-dev
- libwebp-dev

Expand Down
Binary file removed bin/Linux/x86_64/opj_decompress
Binary file not shown.
Binary file removed lib/Linux/x86_64/libopenjp2.so.2.1.0
Binary file not shown.
1 change: 0 additions & 1 deletion lib/Linux/x86_64/libopenjp2.so.7

This file was deleted.

17 changes: 1 addition & 16 deletions loris/transforms.py
Expand Up @@ -279,24 +279,9 @@ def _scales_to_reduce_arg(self, image_request, image_info):
class OPJ_JP2Transformer(_AbstractJP2Transformer):
def __init__(self, config):
self.opj_decompress = config['opj_decompress']
self.env = {
'LD_LIBRARY_PATH' : config['opj_libs'],
'PATH' : config['opj_decompress']
}
self.env = None
super(OPJ_JP2Transformer, self).__init__(config)

@staticmethod
def local_opj_decompress_path():
'''Only used in dev and tests.
'''
return 'bin/%s/%s/opj_decompress' % (platform.system(),platform.machine())

@staticmethod
def local_libopenjp2_dir():
'''Only used in dev and tests.
'''
return 'lib/%s/%s' % (platform.system(),platform.machine())

def _region_to_opj_arg(self, region_param):
'''
Args:
Expand Down
5 changes: 1 addition & 4 deletions loris/webapp.py
Expand Up @@ -70,10 +70,7 @@ def get_debug_config(debug_jp2_transformer):
if debug_jp2_transformer == 'opj':
from loris.transforms import OPJ_JP2Transformer
config['transforms']['jp2']['impl'] = 'OPJ_JP2Transformer'
opj_decompress = OPJ_JP2Transformer.local_opj_decompress_path()
config['transforms']['jp2']['opj_decompress'] = path.join(project_dp, opj_decompress)
libopenjp2_dir = OPJ_JP2Transformer.local_libopenjp2_dir()
config['transforms']['jp2']['opj_libs'] = path.join(project_dp, libopenjp2_dir)
config['transforms']['jp2']['opj_decompress'] = '/usr/bin/opj_decompress'
elif debug_jp2_transformer == 'kdu':
from loris.transforms import KakaduJP2Transformer
config['transforms']['jp2']['impl'] = 'KakaduJP2Transformer'
Expand Down

0 comments on commit b147c89

Please sign in to comment.