camera_camera icon indicating copy to clipboard operation
camera_camera copied to clipboard

Preview Rotion Problem Android

Open klausszilvas opened this issue 3 years ago • 8 comments

When i rotate the phone from portrait to Landscape, the Preview rotates wrong. Portrait is correct, landscape shows wrong rotated preview. flutter_01 flutter_02

klausszilvas avatar Sep 15 '21 07:09 klausszilvas

Any update for this topic?

alexaniko88 avatar Oct 06 '21 14:10 alexaniko88

Oh sorry, i have not seen your question. Problem is still present since update flutter to 2.5, The Preview in Landscape is wrong. two screenshots, may keyboard in Landscape and in Portrait ` MaterialPageRoute( builder: (_) => CameraCamera( cameraSide: CameraSide.all, onFile: (file) async {

          if (file != null) {
            final result = await FlutterImageCompress.compressWithFile(
              file.absolute.path,
              minWidth: 400,
              minHeight: 600,
              quality: 50,
              //rotate: 0,
            );

          ....
            setState(() {
             
              Navigator.pop(context);
            });
          }
        }))`


        
        

flutter_01 flutter_02

klausszilvas avatar Oct 26 '21 13:10 klausszilvas

ok, Problem only in Android. Looks like the CameraStream do no change on Android when the deviceorientation is changed in the Preview. Solved it by using Orientation.builder and Transform() in the Preview for Android. Code is very ugly, but i can send you the code if you are interested.

klausszilvas avatar Oct 29 '21 15:10 klausszilvas

Hello @klausszilvas ,

I have the same issue. Can you share details about your founding : classe / method ? Can you share the corrections you have done on your code ?

Thank you,

mabroukb avatar Nov 10 '21 16:11 mabroukb

Hello @mabroukb in the meanwhile i kicked out the camera_camera plugin, because the code was not stable. I developed a new previewclass based on the example of the camera plugin camerapreview.zip .

klausszilvas avatar Nov 17 '21 06:11 klausszilvas

oh really ? that's sad, I think that plugins and other open libraries are the best way to not reinvent the wheel. thank you for sharing your code 👍

mabroukb avatar Nov 17 '21 15:11 mabroukb

hello @mabroukb , I agree with you. We make programs for mobile documentation. With the programs, customers sometimes take 200 photos per day and device. It is difficult to explain to our customers why the camera previews are displayed incorrectly. So we need a quick solution.

klausszilvas avatar Nov 18 '21 06:11 klausszilvas

I have the same issue, please fix :(

twittergadungan avatar Jan 19 '23 01:01 twittergadungan