FreeImage is a portable graphics library that unifies loading and saving of popular image formats, such as JPEG, TIFF, PNG, TGA, high dynamic range EXR images, and many others.
Download the most recent FreeImage source code from the library home page: http://freeimage.sourceforge.net. We used the Version 3.15.4, released in October 2012.
Both the
Android.mk
andApplication.mk
files are pretty standard. The former should contain this definition of theGLOBAL_CFLAGS
:GLOBAL_CFLAGS := -O3 -DHAVE_CONFIG_H=1 -DFREEIMAGE_LIB-isystem $(SYSROOT)/usr/include/
Unfortunately, the Android NDK runtime library is missing the
lfind()
function used inside FreeImage (in the LibTIFF4 library, which is used in FreeImage). Here is its implementation:void* lfind( const void * key, const void * base, size_t num, size_t width, int (*fncomparison)(const void *, const void * ) ) { char* Ptr = (char*)base; for ( size_t i = 0; i != num; i++, Ptr+...