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

Picture rotate on the Sumsung phone. #36

Closed
Forsaken-sl opened this issue Mar 23, 2017 · 6 comments
Closed

Picture rotate on the Sumsung phone. #36

Forsaken-sl opened this issue Mar 23, 2017 · 6 comments

Comments

@Forsaken-sl
Copy link

Forsaken-sl commented Mar 23, 2017

Hi, this libs really helps a lot, thanks.
But the picture I take within the app, it will rotate -90 on Sumsung phones.
And usully I can get the Exif info with the rotation, but I can't get the rotations with this libs, really confuse me..
So if you have time, please check this out?
By the way, the sumsung phone is SM-G900F and Api 21

@michael-oknov
Copy link

I have the same issue =(

@canberkcakmak
Copy link

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

@Dewinster
Copy link

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"

@smhk
Copy link

smhk commented May 9, 2017

Dewinster, that's an amazingly helpful tip.

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

cameraView.setMethod(CameraKit.Constants.METHOD_STILL);

@hablema
Copy link

hablema commented May 25, 2017

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 ?

@Kwonjube
Copy link

Kwonjube commented Apr 3, 2019

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


        }

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

7 participants