[pHash-support] throwing exceptions from the binding code into the java glue

Evan Klinger eklinger at phash.org
Mon May 17 09:04:50 PDT 2010

Currently we disable CImg exceptions during compilation since they add
considerable overhead. I understand the value they provide, but I'm
wondering if it's possible to have them disabled in CImg/pHash and
simply check the return code from CImg functions and throw exceptions
in the Java code only. For example, if the CImg jpeg load function
fails, the returned pointer will be NULL which can be tested and then
throw your IllegalImageException in Java.


2010/5/17 Alexander Kjäll - alaTest <alex at alatest.com>:
> Hi again
> I solved my problem with libjpeg by upgrading my installation of the CImg
> library to the latest version.
> The next step is to make the exceptions that the CImg library throws visible
> to the java code, i wrote a small patch and a corresponding java exception
> class as a testcase on how it would be possible to do this.
> the exception class should be placed in bindings/java/org/pHash/exceptions/
> This is a rather incomplete patch, and I don't think it should be included
> right away.
> But I would like to get some feedback if you think this is the right
> direction to take the java bindings, before I spend more time on it.
> Any feedback is greatly appreciated.
> best regards
> Alexander Kjäll
> --
> Developer
> alex at alatest.com
> +468343115
> _______________________________________________
> pHash-support mailing list
> pHash-support at lists.phash.org
> http://lists.phash.org/listinfo.cgi/phash-support-phash.org

More information about the pHash-support mailing list