diff --git a/imagededup/__init__.py b/imagededup/__init__.py index 73e3bb4..80eb7f9 100644 --- a/imagededup/__init__.py +++ b/imagededup/__init__.py @@ -1 +1 @@ -__version__ = '0.3.2' +__version__ = '0.3.3' diff --git a/imagededup/utils/image_utils.py b/imagededup/utils/image_utils.py index c922c62..a0f129f 100644 --- a/imagededup/utils/image_utils.py +++ b/imagededup/utils/image_utils.py @@ -4,10 +4,16 @@ import numpy as np from PIL import Image +# enables Pillow HEIF support using https://github.com/bigcat88/pillow_heif +# pi-heif is the same codebase, but more light, HEIF decoder-only version + +from pi_heif import register_heif_opener +register_heif_opener() + from imagededup.utils.logger import return_logger -IMG_FORMATS = ['JPEG', 'PNG', 'BMP', 'MPO', 'PPM', 'TIFF', 'GIF', 'WEBP'] +IMG_FORMATS = ['JPEG', 'PNG', 'BMP', 'MPO', 'PPM', 'TIFF', 'GIF', 'WEBP', 'HEIF'] logger = return_logger(__name__) diff --git a/requirements.txt b/requirements.txt index 55f6a68..6d1a1d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,6 @@ tqdm scikit-learn PyWavelets matplotlib +pi-heif # Development dependencies -cython>=0.29 \ No newline at end of file +cython>=0.29 diff --git a/setup.py b/setup.py index 119ab47..d08aba5 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +import os import sys from setuptools import setup, find_packages, Extension @@ -18,7 +19,7 @@ Read the documentation at: https://idealo.github.io/imagededup/ -imagededup is compatible with Python 3.8+ and runs on Linux, MacOS X and Windows. +imagededup is compatible with Python 3.8+ and runs on Linux, MacOS X and Windows. It is distributed under the Apache 2.0 license. ''' @@ -43,6 +44,10 @@ COMPILE_ARGS_OSX = ['-stdlib=libc++'] LINK_ARGS_OSX = ['-lc++', '-nodefaultlibs'] +# workaround for Cython generated cpp code being compiled with CC, +# not CXX. it causes compilation error with clang/llvm from nixpkgs +os.environ["CC"] = "clang++" + ext_modules = [] if use_cython and on_mac: ext_modules += cythonize([ @@ -89,7 +94,7 @@ setup( name='imagededup', - version='0.3.2', + version='0.3.3', author='Tanuj Jain, Christopher Lennan, Zubin John, Dat Tran', author_email='tanuj.jain.10@gmail.com, christopherlennan@gmail.com, zrjohn@yahoo.com, datitran@gmail.com', description='Package for image deduplication', @@ -102,7 +107,8 @@ 'tqdm', 'scikit-learn', 'PyWavelets', - 'matplotlib' + 'matplotlib', + 'pi-heif' ], extras_require={ 'tests': ['pytest', 'pytest-cov', 'pytest-mock', 'codecov'],