Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
947 stars 234 forks source link

Image orientation is wrong on iPhone #182

Closed michaelhitzker closed 1 year ago

michaelhitzker commented 1 year ago

Steps to Reproduce

I've used this custom builder:

CameraAwesomeBuilder.custom(
      sensor: Sensors.back,
      zoom: 0,
      initialCaptureMode: CaptureMode.photo,
      flashMode: FlashMode.none,
      aspectRatio: CameraAspectRatios.ratio_16_9,
      previewFit: CameraPreviewFit.cover,
      builder: (cameraState) {
        return cameraState.when(
          onPreparingCamera: (state) =>
              const Center(child: CircularProgressIndicator()),
          onPhotoMode: (state) => _TakePhotoUI(),
        );
      },
      saveConfig: SaveConfig.photo(
        pathBuilder: () async {
          final Directory tmpDir = await getTemporaryDirectory();
          final dir =
              await Directory('${tmpDir.path}/wasted').create(recursive: true);
          return '${dir.path}/${DateTime.now().millisecondsSinceEpoch}.jpg';
        },
      ),
    );
  }

Describe how to reproduce the error Take a picture in portrait mode. The image you'll receive is landscape 16:9. And it doesn't match the preview.

Expected results

Should take a picture in portrait mode What it should be

Actual results

Take picture in landscape mode, and doesn't align with what I see in the preview, cause quite some chunks of the picture are cut off due to the camera taking a landscape pic in portrait mode.

See screenshot. On the bottom left you see the actual image taken. And as you can see it doesn't show the monitor that is visible in the preview What you see

issue

About your device

Brand Model OS
Apple iPhone 12 Pro 16.1.1

I've also already updated the UISupportedInferfaceOrientations to only include portrait

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
</array>

michaelhitzker commented 1 year ago

Looks like it's fixed with #183

istornz commented 1 year ago

Yes exactly, this is fixed in the next release 👍 Thanks