Code Monkey home page Code Monkey logo

bither-android-lib's People

Contributors

arjanschouten avatar bithernet avatar jjz avatar leehankyeol avatar songchenwen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bither-android-lib's Issues

how to use this lib

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

The result I got is not as you say "save 5-10 times of image space"?

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.

couldn't find "libjpegbither.so"

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 cannot get libjpegpi.so,I can get libjpegbither.so

ndk-1

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*

How to use the so library in Android studio

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~~

License

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?

I Test With Android 4.0.3,But no Effect

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);
    }
}

}

使用哪个so文件的问题

在readme里下面
System.loadLibrary("jpegpi");
System.loadLibrary("pijni");
在demo里
System.loadLibrary("jpegbither");
System.loadLibrary("bitherjni");

二者好像不是很一样。

直接将jpegbither和bitherjni的so文件复制进目录里,native util的compressBitmap会找不到相应的jni函数。

开发工具是android studio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.