PHash
This library provides NIF bindings to phash and is provided under the same license (GNU GPL).
Installation
From Hex.pm (Recommended)
The package can be installed by adding phash to your list of dependencies in mix.exs:
def deps do
[
{:phash, "~> 0.1"}
]
end
Then run mix deps.get and the library will build automatically. All required source files are included in the Hex package - you don't need to worry about git submodules.
From Source (Development)
If you're contributing to this library, clone the repository and initialize git submodules:
git clone https://github.com/vaartis/phash_ex.git
cd phash_ex
git submodule update --init --recursive
mix deps.get
mix compileNote: Git submodules are only needed for development. Users installing from Hex.pm get all source files automatically.
Requirements
This library requires the following to be installed on your system:
All Platforms
- GCC/G++ or Clang (C++ compiler)
- CMake (version 3.5 or higher)
Linux (Ubuntu/Debian)
sudo apt-get install build-essential cmake libpng-dev libjpeg-dev libtiff-devmacOS
brew install cmake libpng jpeg libtiffThe build system will automatically detect and configure the appropriate library paths for your platform.
Testing
Run the test suite:
mix testThe project includes comprehensive tests covering:
- Image file hashing
- Binary data hashing
- Hash distance calculations
- Error handling
- Integration tests