diff --git a/README.md b/README.md index b22e8c6..4ed9ca5 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,34 @@ Key features: # Install instructions -Installation, usage instructions and more details are available online at http://www.imgseek.net/isk-daemon/documents-1/install-and-usage +Installation, usage instructions and more details are available online at http://www.imgseek.net/isk-daemon/documents-1/install-and-usage [dead link] + +Here are quick guide to build from cloned repo. You may want to ``sudo`` all this commands if you have permission errors. +I assume you know how to build from source and have all build tools and libraries installed for your system. + +##Ubuntu Quick Start + +This one is tested with Ubuntu 14.12 + +1. Install prerequisited if they're not on your system already: + + ``apt-get install swig ImageMagick libmagick++-dev python-dev`` + +2. cd to ./src and run: ``python setup.py install`` + +##MacOS Quick Start + +1. Go to http://brew.sh and install ``Homebrew`` + +2. Install swig: ``brew install swig`` + +3. Install ImageMagick: ``brew install ImageMagick`` + +4. Install pkg-config: ``brew install pkg-config`` + +5. Cd to ./iskdaemon/src/ and run ``python setup.py install`` + +Alternatively, you can try it with ``macports``. # Credits diff --git a/src/core/imgdbapi.py b/src/core/imgdbapi.py index f1af144..bf303d0 100644 --- a/src/core/imgdbapi.py +++ b/src/core/imgdbapi.py @@ -42,7 +42,7 @@ pbFactory = None # perspective factory daemonStartTime = time.time() hasShutdown = False -iskVersion = "0.9.3" +iskVersion = "0.9.5" # misc daemon inits rootLog = logging.getLogger('imgdbapi') diff --git a/src/imgSeekLib/imgdb.cpp b/src/imgSeekLib/imgdb.cpp index 96c7021..dba2fd1 100755 --- a/src/imgSeekLib/imgdb.cpp +++ b/src/imgSeekLib/imgdb.cpp @@ -990,7 +990,7 @@ std::vector queryImgID(const int dbId, long int id, int numres, int sket long int sz = dbSpace[dbId]->sigs.size(); int_hashset includedIds; sigIterator it = dbSpace[dbId]->sigs.begin(); - for (int var = 0; var < min(sz, numres); ) { // var goes from 0 to numres + for (int var = 0; var < min(sz, numres); ) { // var goes from 0 to numres long int rint = rand()%(sz); for(int pqp =0; pqp < rint; pqp++) { it ++; @@ -1313,7 +1313,7 @@ std::vector queryImgIDKeywords(const int dbId, long int id, int numres, vector Vres; - for (int var = 0; var < min(V.size()/2, numres); ) { // var goes from 0 to numres + for (int var = 0; var < min(V.size()/2, numres); ) { // var goes from 0 to numres int rint = rand()%(V.size()/2); if (V[rint*2] > 0) { // havent added this random result yet Vres.insert(Vres.end(), V[rint*2] ); diff --git a/src/installer.nsi b/src/installer.nsi index 4e2bb83..2c1409e 100644 --- a/src/installer.nsi +++ b/src/installer.nsi @@ -2,7 +2,7 @@ ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "isk-daemon" -!define PRODUCT_VERSION "0.9.3" +!define PRODUCT_VERSION "0.9.5" !define PRODUCT_PUBLISHER "imgSeek" !define PRODUCT_WEB_SITE "http://server.imgseek.net/" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\isk-daemon.exe" diff --git a/src/setup.py b/src/setup.py index 1e187d2..469b842 100755 --- a/src/setup.py +++ b/src/setup.py @@ -4,6 +4,7 @@ # win/linux diffs import os +import subprocess # reuse README as package long description with open('README.txt') as file: @@ -46,28 +47,33 @@ # extra_compile_args += ["-DNeedFunctionPrototypes"] # extra_compile_args += ["-D_DLL"] extra_compile_args += ["-D_MAGICKMOD_"] -else: # *nix +else: # *nix hasIMagick=0 extra_compile_args += [ "-DLinuxBuild","-g"] extra_link_args += ["-g"] print "#################################### Check ImageMagick" try: - fnd=0 - pathvar=os.environ["PATH"] - for pv in split(pathvar,':'): - if os.path.exists(pv+'/Magick++-config') or os.path.exists(pv+'Magick++-config'): - fnd=1 + fnd = False + pathvar = os.environ["PATH"] + for pv in split(pathvar, ':'): + if os.path.exists(pv + '/Magick++-config') or os.path.exists(pv + 'Magick++-config'): + fnd = True + break # pv now holds directory in which Magick++-config was found if fnd: - IMagCFlag=os.popen("Magick++-config --cxxflags --cppflags").read() - if find(IMagCFlag,"-I") != -1: - IMagCFlag=replace(IMagCFlag,"\n"," ") - IMagCFlag=split(IMagCFlag,' ') - IMagCLib=os.popen("Magick++-config --ldflags --libs").read() - IMagCLib=replace(IMagCLib,"\n"," ") - IMagCLib=split(IMagCLib,' ') - hasIMagick=1 + #IMagCFlag = os.popen("Magick++-config --cxxflags --cppflags").read() # That's deprecated now + IMagCFlag = subprocess.check_output(["Magick++-config", "--cxxflags", "--cppflags"]) + if find(IMagCFlag, "-I") != -1: + if len(include_dirs) == 0: # Extract include dir from latter command output and append to include_dirs + include_dirs.append([i[2:] for i in IMagCFlag.split(' ') if i.startswith("-I")][0]) + IMagCFlag = replace(IMagCFlag, "\n", " ") + IMagCFlag = split(IMagCFlag, ' ') + IMagCLib = subprocess.check_output(["Magick++-config", "--ldflags", "--libs"]) + IMagCLib = replace(IMagCLib, "\n", " ") + IMagCLib = split(IMagCLib, ' ') + hasIMagick = 1 else: print "--- WARNING ---\nUnable to find Magick++-config. Are you sure you have ImageMagick and it's development files installed correctly?" + except: traceback.print_exc() diff --git a/src/test/test_api.py b/src/test/test_api.py index c212e52..37767da 100644 --- a/src/test/test_api.py +++ b/src/test/test_api.py @@ -23,6 +23,7 @@ ############################################################################### import xmlrpclib +import os from optparse import OptionParser parser = OptionParser() diff --git a/src/ui/admin-gwt/src/net/imgseek/server/admin/client/Iskdaemon_admin.java b/src/ui/admin-gwt/src/net/imgseek/server/admin/client/Iskdaemon_admin.java index 7d51b34..4e7b8bd 100644 --- a/src/ui/admin-gwt/src/net/imgseek/server/admin/client/Iskdaemon_admin.java +++ b/src/ui/admin-gwt/src/net/imgseek/server/admin/client/Iskdaemon_admin.java @@ -33,8 +33,8 @@ public class Iskdaemon_admin implements EntryPoint, ValueChangeHandler { private static final String SERVER_ERROR = "An error occurred while " + "attempting to contact the server. Please check your network " + "connection and try again."; - public static final String VERSION = "0.9.3"; - public static final String RELEASEDATE = "Jan 2012"; + public static final String VERSION = "0.9.5"; + public static final String RELEASEDATE = "Mar 2014"; protected static String WEB_ENDPOINT = "/"; public static final String XMLRPC_BACKEND = WEB_ENDPOINT + "RPC"; protected static SinkList list = new SinkList();