Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request for opening file from the qr image #55

Open
jjhesk opened this issue May 14, 2016 · 1 comment
Open

feature request for opening file from the qr image #55

jjhesk opened this issue May 14, 2016 · 1 comment

Comments

@jjhesk
Copy link

jjhesk commented May 14, 2016

if that possible to use the eu.livotov.labs.android.camview.scanner.decoder.zxing.ZXDecoder decode the image that is picked from the gallery folder?

@jjhesk
Copy link
Author

jjhesk commented May 14, 2016

I have tried this approach but it doesnt get lucky..

    @Override
    protected String doInBackground(File[] params) {
        byte[] byeImage;
        String messagew = "";
        try {
           // byeImage = Utilities.readBytesFromFile(params[0]);
            BitmapFactory.Options options = new BitmapFactory.Options();
            options.inJustDecodeBounds = true;
            BitmapFactory.decodeFile(params[0].getAbsolutePath(), options);
            ZXDecoder decoder = new ZXDecoder();
            decoder.setScanAreaPercent(1.0);
            String decodedcontent = decoder.decode(options.inTempStorage, options.outWidth, options.outHeight);
            mRe.extraTaskAfterDecodeQR(decodedcontent);
            return decodedcontent;
        } catch (IOException e) {
            e.printStackTrace();
            messagew = e.getLocalizedMessage();
            good = false;
        } catch (Exception e) {
            messagew = e.getMessage();
            good = false;
        }
        return messagew;
    }

the above shows where decodedcontent always gets null as return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant