forked from Sunzxyong/Tiny
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
974 changed files
with
150,831 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 26 | ||
|
||
defaultConfig { | ||
minSdkVersion 16 | ||
targetSdkVersion 26 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/Sunzxyong/Library/Android/sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.zxy.libjpegturbo"> | ||
|
||
<application> | ||
|
||
</application> | ||
|
||
</manifest> |
28 changes: 28 additions & 0 deletions
28
libjpeg-turbo-sdk/src/main/java/com/zxy/libjpegturbo/JpegTurboCompressor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.zxy.libjpegturbo; | ||
|
||
import android.graphics.Bitmap; | ||
|
||
/** | ||
* Created by zhengxiaoyong on 2017/2/23. | ||
*/ | ||
public class JpegTurboCompressor { | ||
|
||
public static boolean compress(Bitmap bitmap, String outfile, int quality) { | ||
return nativeCompress(bitmap, outfile, quality, true); | ||
} | ||
|
||
public static String getVersion() { | ||
return "libjpeg-turbo api version : " + getLibjpegTurboVersion() + ", libjpeg api version : " + getLibjpegVersion(); | ||
} | ||
|
||
static { | ||
System.loadLibrary("tiny"); | ||
} | ||
|
||
private static native boolean nativeCompress(Bitmap bitmap, String outfile, int quality, boolean optimize); | ||
|
||
private static native int getLibjpegTurboVersion(); | ||
|
||
private static native int getLibjpegVersion(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
LOCAL_PATH := $(call my-dir) | ||
include $(CLEAR_VARS) | ||
|
||
# LOCAL_MODULE := libjpeg-turbo | ||
# LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libjpeg-turbo.so | ||
LOCAL_MODULE := libjpeg-turbo-static | ||
LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libjpeg-turbo-static.a | ||
|
||
# include $(PREBUILT_SHARED_LIBRARY) | ||
include $(PREBUILT_STATIC_LIBRARY) | ||
|
||
include $(CLEAR_VARS) | ||
LOCAL_MODULE := tiny | ||
# LOCAL_SHARED_LIBRARIES := libjpeg-turbo | ||
LOCAL_STATIC_LIBRARIES := libjpeg-turbo-static | ||
LOCAL_SRC_FILES := com_zxy_libjpegturbo_JpegTurboCompressor.c | ||
LOCAL_LDLIBS := -ljnigraphics -llog | ||
LOCAL_C_INCLUDES := $(LOCAL_PATH) \ | ||
$(LOCAL_PATH)/include \ | ||
|
||
include $(BUILD_SHARED_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
LOCAL_PATH := $(call my-dir) | ||
include $(CLEAR_VARS) | ||
NDK_TOOLCHAIN_VERSION := 4.9 | ||
APP_PLATFORM := android-14 | ||
APP_ABI := armeabi,armeabi-v7a,arm64-v8a,x86 | ||
APP_OPTIM := release | ||
APP_BUILD_SCRIPT := $(LOCAL_PATH)/Android.mk |
Oops, something went wrong.