Skip to content

[Android: E_NO_IMAGE_DATA_FOUND] openCropper has an error and I can't crop the image #2216

@hukuryo

Description

@hukuryo

Overview

I want to crop an image using openCropper, but I encounter the following error:

[Error: file]

E_NO_IMAGE_DATA_FOUND

The error only occurs on Android devices with the latest security patches applied.

Affected Device

The error only occurs on the following device:

  • Android Pixel 8a
  • Version 16
  • Latest security patches applied

This error does not occur on iOS.

Source

 try {
    console.log("path", photo.path);
    const croppedImage = await ImageCropPicker.openCropper({
      path: photo.path,
      width: image.width,
      height: image.height,
      cropping: true,
      mediaType: "photo",
      cropperCircleOverlay: false,
      freeStyleCropEnabled: false,
      includeBase64: false,
      includeExif: false,
      cropperRotateButtonsHidden: true,
      cropperChooseText: "OK",
      cropperCancelText: "CANCEL",
      cropperToolbarTitle: "CROP",
      hideBottomControls: true,
      showCropGuidelines: false,
      cropperChooseColor: "#ffffff",
      cropperCancelColor: "007AFF",
    });
    setImage({
      uri: croppedImage.path,
      width: croppedImage.width,
      height: croppedImage.height,
      fileName: image.fileName,
      type: "image",
    });
  } catch (error) {
    console.log("=== エラー詳細 ===");
    console.log("error:", error);
    console.log("error.message:", (error as any).message);
    console.log("error.code:", (error as any).code);
    console.log("typeof error:", typeof JSON.stringify(error));
    console.log("JSON:", JSON.stringify(error));
  }

The image is in jpeg format

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions