Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEIF format support (fixes #207) #215

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion imagededup/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.3.2'
__version__ = '0.3.3'
8 changes: 7 additions & 1 deletion imagededup/utils/image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)


Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ tqdm
scikit-learn
PyWavelets
matplotlib
pi-heif
# Development dependencies
cython>=0.29
cython>=0.29
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import sys
from setuptools import setup, find_packages, Extension

Expand All @@ -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.
'''

Expand All @@ -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([
Expand Down Expand Up @@ -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='[email protected], [email protected], [email protected], [email protected]',
description='Package for image deduplication',
Expand All @@ -102,7 +107,8 @@
'tqdm',
'scikit-learn',
'PyWavelets',
'matplotlib'
'matplotlib',
'pi-heif'
],
extras_require={
'tests': ['pytest', 'pytest-cov', 'pytest-mock', 'codecov'],
Expand Down