Giter Site home page Giter Site logo

Comments (6)

hablema avatar hablema commented on May 19, 2024 4

Hi,

camerakit:ckMethod="still" is a nice way to solve the problem as the preview is returned but is there any other way so that i can use the flash which works only in standard mode when image is taken from camera ?

from camerakit-android.

Dewinster avatar Dewinster commented on May 19, 2024 3

I had the same issue, but solved it by using a different method of taking a picture by calling this function in the code:

cameraView.setMethod(CameraKit.Constants.METHOD_STILL);

Or this in you layout file:

camerakit:ckMethod="still"

from camerakit-android.

smhk avatar smhk commented on May 19, 2024 2

Dewinster, that's an amazingly helpful tip.

Thank you so much - I wish I could send money! :)

cameraView.setMethod(CameraKit.Constants.METHOD_STILL);

from camerakit-android.

michael-oknov avatar michael-oknov commented on May 19, 2024

I have the same issue =(

from camerakit-android.

canberkcakmak avatar canberkcakmak commented on May 19, 2024

you have to get exif images then rotate image with this code. after save bitmap on taken picture. This is the best solution of rotated images.

        switch(orientation) {

            case ExifInterface.ORIENTATION_ROTATE_90:
                selectedBitmap =rotateImage(selectedBitmap, 90);
                break;

            case ExifInterface.ORIENTATION_ROTATE_180:
                selectedBitmap =  rotateImage(selectedBitmap, 180);
                break;

            case ExifInterface.ORIENTATION_ROTATE_270:
                selectedBitmap =  rotateImage(selectedBitmap, 270);
                break;

            case ExifInterface.ORIENTATION_NORMAL:
                selectedBitmap =  rotateImage(selectedBitmap, 0);

            default:
                break;
        }

from camerakit-android.

Kwonjube avatar Kwonjube commented on May 19, 2024

Has this issue been resolved? I'm still getting this problem with an samsung galaxy 10.1 (SM-T580) android 7.0
The output file is just randomly rotated 90 degree, i've fixed the screen orientation so the capture and preview screen are always correct

 if (jpeg != null) {
            imageView.setVisibility(View.VISIBLE);

            Bitmap bitmap = BitmapFactory.decodeByteArray(jpeg, 0, jpeg.length);
            if (bitmap == null) {
                finish();
                return;
            }

            imageView.setImageBitmap(bitmap);
            actualResolution.setText(bitmap.getWidth() + " x " + bitmap.getHeight());
            approxUncompressedSize.setText(getApproximateFileMegabytes(bitmap) + "MB");
            captureLatency.setText(ResultHolder.getTimeToCallback() + " milliseconds");
            File savedPhoto = new File(Environment.getExternalStorageDirectory(), "photo.jpg");
            try {
                FileOutputStream outputStream = new FileOutputStream(savedPhoto.getPath());
                outputStream.write(jpeg);
                outputStream.close();
            } catch (java.io.IOException e) {
                e.printStackTrace();
            }


        }

from camerakit-android.

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.