Git Product home page Git Product logo

android-bpg's People

Contributors

alexandruc avatar

Stargazers

 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

android-bpg's Issues

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xdeadbaad

Hi,I need your help,I'm not good at clang, so I don't know what to do。
1.I test this library in my project, The vast majority of mobile phones can work. but I do monkey test on someone, it reports Native Crash.
2.I used https://github.com/nostra13/Android-Universal-Image-Loader and Customize my own Downloader(using bpg decoder https://github.com/nostra13/Android-Universal-Image-Loader/blob/master/sample/src/main/java/com/nostra13/universalimageloader/sample/ext/OkHttpImageDownloader.java )
3.I consulted a lot of information and test ,the crash line is this method(decoder.c-->bmp_save_to_buffer()-->free(rgb_line) ) , I find this https://groups.google.com/forum/#!topic/android-ndk/jQg6DM6-D6o
image

please help me , I don't know how to solve.

Monkey log:
// CRASH: com.xmtj.mkz (pid 24884)
// Short Msg: Native crash
// Long Msg: Native crash: Segmentation fault
// Build Label: SMARTISAN/msm8916_32:5.1.1/LMY47V/59:user/release-keys
// Build Changelist: 59
// Build Time: 1484324676000
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Build fingerprint: 'SMARTISAN/msm8916_32:5.1.1/LMY47V/59:user/release-keys'
// Revision: '0'
// ABI: 'arm'
// pid: 24884, tid: 25593, name: uil-pool-1-thre >>> com.xmtj.mkz <<<
// signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xdeadbaad
// Abort message: 'invalid address or address of corrupt block 0xb83b4cb0 passed to dlfree'
// r0 00000000 r1 b6e89dec r2 deadbaad r3 00000000
// r4 b83b4cb0 r5 b6e8b0f8 r6 00000000 r7 00000200
// r8 00000db5 r9 98794838 sl 00001de4 fp 00000db5
// ip 00000000 sp 98794780 lr b6e5bdaf pc b6e5bdb0 cpsr 680f0030
//
// backtrace:
// #00 pc 00028db0 /system/lib/libc.so (dlfree+1239)
// #1 pc 0000f2b3 /system/lib/libc.so (free+10)
// #2 pc 00005a99 /data/app/com.xmtj.mkz-1/lib/arm/libbpg_decoder.so (decode_buffer+412)
// #3 pc 00005de5 /data/app/com.xmtj.mkz-1/lib/arm/libbpg_decoder.so (Java_com_xmtj_bpgdecoder_DecoderWrapper_decodeBuffer+108)
// #4 pc 0066c7a5 /data/dalvik-cache/arm/data@[email protected]@[email protected]
//
// Injection Failed
** Monkey aborted due to error.

Image Can't show All

I used your src file in android studio,Build success and run , But the image can't show all.
device-2017-01-22-154656

After the background transparent PNG is converted to BPG, it is converted to PNG by bpg_ decoder for preservation, and the transparent background becomes black

-----------use bpg_decoder get a bitmap:
public static Bitmap getDecodedBpgBitmap(Context context, File bpgFile) throws FileNotFoundException {
Bitmap bm = null;
try {
FileInputStream fis = new FileInputStream(bpgFile);
byte[] byteArray = toByteArray(fis);
byte[] decBuffer = null;
int decBufferSize = 0;
decBuffer = DecoderWrapper.decodeBuffer(byteArray, byteArray.length);
decBufferSize = decBuffer.length;

        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inPreferredConfig = Bitmap.Config.ARGB_8888;
        options.inDither=false;

        if (decBuffer != null) {
           bm = BitmapFactory.decodeByteArray(decBuffer, 0, decBufferSize,options);
        }
    } catch (IOException ex) {
        TLog.e("getDecodedBpgBitmap", "Failed to convert image to byte array");
    }
    return bm;
}

--------------and save the bitmap to PNG ,but the transparent background became to black.
bpgBitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream)

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.