Skip to content

Front Camera Captures Flipped Image Horizontally #293

Open
@Zobayer-Mahmud

Description

@Zobayer-Mahmud

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    await investigateThe issue is waiting for further investigation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions