Skip to content

Front Camera Captures Flipped Image Horizontally #293

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

Open
Zobayer-Mahmud opened this issue Feb 18, 2025 · 0 comments
Open

Front Camera Captures Flipped Image Horizontally #293

Zobayer-Mahmud opened this issue Feb 18, 2025 · 0 comments
Labels
await investigate The issue is waiting for further investigation.

Comments

@Zobayer-Mahmud
Copy link

When using the front camera to capture an image, the resulting image is flipped horizontally.

How to Reproduce
Steps to reproduce the behavior:

Call the pickImageWithCamera method.
Capture an image using the front camera.
Observe that the image captured is flipped horizontally.
Expected Behavior
The captured image should not be flipped when taken from the front camera.

Version Information
Device: Realme C51
OS: Android (Version information not specified)
Package Version: wechat_assets_picker: ^9.4.2
Flutter Version: 3.27.1


import 'package:wechat_camera_picker/wechat_camera_picker.dart'
    as we_chat_camera;

Future<XFile?> pickImageWithCamera(BuildContext context) async {
  print("pickImageWithCamera: Camera Picker opened");

  final we_chat_camera.AssetEntity? entity =
      await we_chat_camera.CameraPicker.pickFromCamera(
    context,
    pickerConfig: const we_chat_camera.CameraPickerConfig(
      enableRecording: false,
      lockCaptureOrientation: DeviceOrientation.portraitUp,

    ),
    locale: Locale(Get.find<LanguageController>().currentLanguage),
  );

  if (entity == null) {
    print("pickImageWithCamera: No image captured (entity is null)");
    return null;
  }
  print("pickImageWithCamera: Image captured - ID: ${entity.id}");

  // Get the file from the AssetEntity
  final File? file = await entity.file;
  if (file != null) {
    print("pickImageWithCamera: File path - ${file.path}");

    // Convert File to XFile and return
    return XFile(file.path);
  } else {
    print("pickImageWithCamera: Failed to retrieve file");
    return null;
  }
}
@Zobayer-Mahmud Zobayer-Mahmud added the await investigate The issue is waiting for further investigation. label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
await investigate The issue is waiting for further investigation.
Projects
None yet
Development

No branches or pull requests

1 participant