Commit 2f203d4f authored by Manuel Günther's avatar Manuel Günther
Browse files

Merge branch 'master' of https://github.com/bioidiap/bob.io.image

parents 8fea0e14 621e9ede
...@@ -25,6 +25,12 @@ def libjpeg_version(header): ...@@ -25,6 +25,12 @@ def libjpeg_version(header):
minor = int(version[1].group(2)) minor = int(version[1].group(2))
return '%d.%d' % (major, minor) return '%d.%d' % (major, minor)
def libjpeg_turbo_version(header):
version = egrep(header, r"#\s*define\s+LIBJPEG_TURBO_VERSION\s+([\d\.]+)")
if not len(version): return None
return version[0].group(1) + ' (turbo)'
class jpeg: class jpeg:
def __init__ (self, requirement='', only_static=False): def __init__ (self, requirement='', only_static=False):
...@@ -59,6 +65,13 @@ class jpeg: ...@@ -59,6 +65,13 @@ class jpeg:
if not requirement: if not requirement:
self.include_directory = os.path.dirname(candidates[0]) self.include_directory = os.path.dirname(candidates[0])
self.version = libjpeg_version(candidates[0]) self.version = libjpeg_version(candidates[0])
# special condition (using libjpeg-turbo instead)
if self.version is None:
turbo_candidates = find_header('jconfig.h')
if turbo_candidates:
self.version = libjpeg_turbo_version(turbo_candidates[0])
found = True found = True
else: else:
...@@ -407,6 +420,7 @@ setup( ...@@ -407,6 +420,7 @@ setup(
packages=find_packages(), packages=find_packages(),
include_package_data=True, include_package_data=True,
zip_safe=False,
install_requires=[ install_requires=[
'setuptools', 'setuptools',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment