Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Remove non-POSIX memory I/O. Partially addresses #25. Fixes #56. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rmtheis committed Aug 13, 2014
1 parent 72096fd commit bde4c1a
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 762 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,7 @@

package com.googlecode.leptonica.android.test;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.test.suitebuilder.annotation.SmallTest;

import com.googlecode.leptonica.android.Constants;
import com.googlecode.leptonica.android.Pix;
import com.googlecode.leptonica.android.ReadFile;
import com.googlecode.leptonica.android.WriteFile;

import junit.framework.TestCase;

public class WriteFileTest extends TestCase {
@SmallTest
public void testWriteMem() {
Bitmap bmps = Bitmap.createBitmap(640, 480, Bitmap.Config.ARGB_8888);
Pix pixs = ReadFile.readBitmap(bmps);
byte[] encodedBytes = WriteFile.writeMem(pixs, Constants.IFF_BMP);

assertNotNull(encodedBytes);

Bitmap bmpd = BitmapFactory.decodeByteArray(encodedBytes, 0, encodedBytes.length);

assertEquals(bmps.getWidth(), bmpd.getWidth());
assertEquals(bmps.getHeight(), bmpd.getHeight());

bmps.recycle();
pixs.recycle();
encodedBytes = null;
bmpd.recycle();
}
}
1 change: 0 additions & 1 deletion tess-two/jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ APP_ABI := armeabi armeabi-v7a mips x86
APP_OPTIM := release
APP_PLATFORM := android-8
APP_CPPFLAGS += -fexceptions -frtti
NDK_TOOLCHAIN_VERSION := 4.8
11 changes: 0 additions & 11 deletions tess-two/jni/com_googlecode_leptonica_android/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ LOCAL_CFLAGS := \
LOCAL_LDLIBS := \
-lz

# missing stdio functions

ifneq ($(TARGET_SIMULATOR),true)
LOCAL_SRC_FILES += \
stdio/open_memstream.c \
stdio/fopencookie.c \
stdio/fmemopen.c
LOCAL_C_INCLUDES += \
stdio
endif

# jni

LOCAL_SRC_FILES += \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
#define HAVE_LIBZ 1
#define HAVE_LIBGIF 0
#define HAVE_LIBUNGIF 0
#define HAVE_FMEMOPEN 1
#define HAVE_FMEMOPEN 0

#endif
27 changes: 0 additions & 27 deletions tess-two/jni/com_googlecode_leptonica_android/stdio/extrastdio.h

This file was deleted.

277 changes: 0 additions & 277 deletions tess-two/jni/com_googlecode_leptonica_android/stdio/fmemopen.c

This file was deleted.

Loading

0 comments on commit bde4c1a

Please sign in to comment.