bither / bither-android-lib Goto Github PK
View Code? Open in Web Editor NEWBither Android Library
Home Page: http://Bither.net
License: Apache License 2.0
Bither Android Library
Home Page: http://Bither.net
License: Apache License 2.0
cd ../libjpeg-turbo-android/libjpeg-turbo/jni
ndk-build
I cannot get libjpegpi.so in../libjpeg-turbo-android/libjpeg-turbo/libs/armeabi
I get libjpegbither.so
bither-android-lib/libjpeg-turbo-android/libjpeg-turbo/libs/armeabi
drwxrwxr-x 2 malin malin 4096 12月 4 17:36 ./
drwxrwxr-x 3 malin malin 4096 12月 4 17:36 ../
-rwxrwxr-x 1 malin malin 30096 12月 4 17:36 cjpeg*
-rwxrwxr-x 1 malin malin 25940 12月 4 17:36 djpeg*
-rwxrwxr-x 1 malin malin 25880 12月 4 17:36 jpegtran*
-rwxrwxr-x 1 malin malin 230784 12月 4 17:36 libjpegbither.so*
-rwxrwxr-x 1 malin malin 13592 12月 4 17:36 rdjpgcom*
-rwxrwxr-x 1 malin malin 42624 12月 4 17:36 tjbench*
-rwxrwxr-x 1 malin malin 26012 12月 4 17:36 tjunittest*
-rwxrwxr-x 1 malin malin 17688 12月 4 17:36 wrjpgcom*
libjpegbither.so is 32-bit instead of 64-bit , Don't it support 64 - bit ?
在readme里下面
System.loadLibrary("jpegpi");
System.loadLibrary("pijni");
在demo里
System.loadLibrary("jpegbither");
System.loadLibrary("bitherjni");
二者好像不是很一样。
直接将jpegbither和bitherjni的so文件复制进目录里,native util的compressBitmap会找不到相应的jni函数。
开发工具是android studio
At first, I appreciate your great work for resolving the difficult jpeg quality problem of Android OS.
I faced the same problem and REASON.md
really helped me.
I'd like to use this code for my project. Would you determine its license?
If this is ture, google must can find and resolve it.
Hope supported
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.testjpg-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.testjpg-1/lib/arm64, /data/app/com.example.testjpg-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libjpegbither.so"
I download your project and test the NativeUtil.compressBitmap method. the result is not as good as you say.
I use 4 pictures. here is the result:
picture | optimize_coding = false | optimize_coding = true | jpeg compress ratio |
---|---|---|---|
picture 1 | 46KB | 44KB | 50 |
picture 2 | 62KB | 59KB | 50 |
picture 3 | 215KB | 194KB | 100 |
picture 4 | 369KB | 348KB | 100 |
Obviously, the size which set optimize_coding to false are only 1.05 - 1.10 times of the others, not as you say "save 5-10 times of image space". And the image quality is almost same.
Is there something wrong? Expect your reply!
Thanks.
i create tropicalfish_3.jpg,tropicalfish_1.jpg,tropicalfish_2.jpg i think Image effects no change.
my code:
package com.example.testlibjpeg;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import com.pi.common.util.NativeUtil;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
import android.os.Bundle;
public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String path = "/mnt/sdcard/DCIM/Camera/";
String filePath = path + "tropicalfish.jpg";
File file = new File(filePath);
if (file.exists())
{
Bitmap bitmap = BitmapFactory.decodeFile(filePath);
File file2 = new File(path + "tropicalfish_3.jpg");
try
{
bitmap.compress(CompressFormat.JPEG, 60, new FileOutputStream(file2));
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
NativeUtil.compressBitmap(bitmap, 60, path+"tropicalfish_1.jpg", false);
NativeUtil.compressBitmap(bitmap, 60, path+"tropicalfish_2.jpg", true);
}
}
}
while i use your test code in eclipse, it works fine。but when i use it in android studio, it always failed.
java.lang.UnsatisfiedLinkError: Couldn't load jpegpi from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.nice.main-6.apk,libraryPath=/data/app-lib/com.nice.main-6]: findLibrary returned null
how can i fix it in android studio. Thanks~~
readme:
System.loadLibrary("jpegpi");
System.loadLibrary("pijni");
demo:
System.loadLibrary("jpegbither");
System.loadLibrary("bitherjni");
it is difference.
and when i you it , there are some some wrong "Native method not found"
anyone know how to do it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.