Giter Club home page Giter Club logo

Comments (6)

xu-li avatar xu-li commented on May 30, 2024

@clock157 麻烦问一下你的android版本?wechat插件的版本?缩略图的URL是什么?

from cordova-plugin-wechat.

huip avatar huip commented on May 30, 2024

我也遇到类似问题

Unable to decode stream: java.io.FileNotFoundException: /data/data/

from cordova-plugin-wechat.

clock157 avatar clock157 commented on May 30, 2024

@xu-li android-22 插件是你最新的,图片是:http://img.yptt.com/cc/ac/ccac20d5ca57a006f71d900f94c5c283.jpg@!180x180
最后我找资料修改了一下解决了:
http://www.cnblogs.com/wsfjlagr/p/3711796.html

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 30, 2024

@clock157 原来没有处理远程的图片。应该改成

protected Bitmap getBitmap(JSONObject message, String key) {
        String url = getImageURL(message, key);
        HttpURLConnection conn = null;
        InputStream is = null;
        Bitmap bmp = null;

        if (url != null) {
            try {
                if (URLUtil.isHttpUrl(url) || URLUtil.isHttpsUrl(url)) {
                    conn = (HttpURLConnection)new URL(url).openConnection();
                    is = conn.getInputStream();
                } else {
                    is = new FileInputStream(url);
                }

                bmp = BitmapFactory.decodeStream(is);
                is.close();
            } catch (Exception e) {
                Log.e(TAG, "Failed to decode image at " + url, e);
                bmp = null;
            } finally {
                if (conn != null) {
                    conn.disconnect();
                }
            }
        }

        return bmp;
    }

我还在测试其它问题,回头发布一个新的版本。

from cordova-plugin-wechat.

clock157 avatar clock157 commented on May 30, 2024

感谢你的分享:)

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 30, 2024

@clock157 已经更新。哈哈哈。可以尝试一下。

from cordova-plugin-wechat.

Related Issues (20)

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.