Skip to content

Commit

Permalink
Add Windows support by embedding pHash, libpng and zlib.
Browse files Browse the repository at this point in the history
  • Loading branch information
schulzch committed Feb 8, 2015
1 parent fe5d435 commit d8f81d2
Show file tree
Hide file tree
Showing 75 changed files with 104,723 additions and 33 deletions.
12 changes: 1 addition & 11 deletions README.md
Expand Up @@ -12,17 +12,7 @@

## Installation

node-phash depends on [CImg](http://cimg.sourceforge.net/), [pHash](http://www.phash.org/), [ImageMagicK](http://www.imagemagick.org/).

On Ubuntu:

sudo apt-get install cimg-dev libphash0-dev libmagickcore-dev

On OSX:

brew install phash imagemagick

Then, install using npm:
Install using npm:

$ npm install phash

Expand Down
20 changes: 15 additions & 5 deletions binding.gyp
@@ -1,8 +1,21 @@
{
'targets': [
{
'target_name': 'pHash',
'sources': [ 'phash.cpp' ],
'target_name': 'pHashBinding',
'defines': [
'HAVE_IMAGE_HASH',
'cimg_use_png',
],
'include_dirs': [
'deps/pHash',
'deps/libpng',
],
'sources': [ 'src/phash.cpp' ],
'dependencies': [
'deps/zlib/zlib.gyp:zlib',
'deps/libpng/libpng.gyp:libpng',
'deps/pHash/pHash.gyp:phash',
],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'conditions': [
Expand All @@ -12,9 +25,6 @@
}
}]
],
'link_settings': {
'libraries': ['-lpHash']
}
}
]
}
Expand Down
32 changes: 32 additions & 0 deletions deps/libpng/libpng.gyp
@@ -0,0 +1,32 @@
{
'targets': [
{
'target_name': 'libpng',
'type': 'static_library',
'defines': [
],
'include_dirs': [
'.',
'../zlib'
],
'sources': [
'png.c',
'pngerror.c',
'pngget.c',
'pngmem.c',
'pngpread.c',
'pngread.c',
'pngrio.c',
'pngrtran.c',
'pngrutil.c',
'pngset.c',
'pngtest.c',
'pngtrans.c',
'pngwio.c',
'pngwrite.c',
'pngwtran.c',
'pngwutil.c',
],
},
]
}

0 comments on commit d8f81d2

Please sign in to comment.