Android NDK libtiff + libjpeg not decode images

508 views Asked by At

Main problem is that I'm getting fully black image when trying decode tiff file that has jpeg compression. I'm trying to build libtiff for android. libtiff uses libjpeg to decode files with jpeg compression. Before building libtiff I built libjpeg-6b from sources with this parameters in Android.mk

include $(CLEAR_WARS)
LOCAL_MODULE := libjpeg
LOCAL_CFLAGS += -O3 -fstrict-aliasing
LOCAL_SRC_FILES:= $(LOCAL_JPEG_SRC_FILES)
include $(BUILD_STATIC_LIBRARY)

After that I'm trying build libtiff with this options in Android.mk

LOCAL_SRC_FILES:= $(LOCAL_TIFF_SRC_FILES)
LOCAL_C_INCLUDES += \
                    $(LOCAL_PATH)/tiff/libtiff \
                    $(LOCAL_PATH)/jpeg

LOCAL_CFLAGS += -DAVOID_TABLES
LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays
LOCAL_MODULE:= libtiff
LOCAL_LDLIBS := -lz

LOCAL_LDLIBS += $(LOCAL_PATH)/libs/$(TARGET_ARCH_ABI)/libjpeg.a

include $(BUILD_SHARED_LIBRARY)

Building process was finished OK, but after that, when I'm trying to decode tiff file that was created with jpeg compression I'm getting fully black image.

I tried 6 and 8 version of libjpeg - same result.

For now I haven't idea what I should do. Also I found assembled binaries of libjpeg for arm and x86 ABIs and they work correctly, but I need support for x64 ABIs, so I should build my own libjpeg.

0

There are 0 answers