Skip to content

Crop result wrong on iOS 16.3 #163

Open

Description

@jordam1407

Environment

Phisical Device: iPhone 13 Pro Max
OS: iOS 16.2.7

Project:
"react-native": "0.74.3",
"@react-native-community/image-editor": "^4.2.0",
"expo": "~51.0.23",
"react-native-vision-camera": "^4.5.1",

Description

The crop result is outside what was expected

*This code works perfectly in all other devices/emulators and OS versions, for both Android, iOS.

This bug only happen when I got a picture from react native vision camera, when picked with expo-image-picker, it works fine!

The green toast in end of the video is:
Original Image Height and Image Width

Image crop area Height and Width
Position X and Y above the Image crop area

CROP_ERROR.mp4

Reproducible Demo

  const handlePress = async () => {
    try {
      setTranscriptionLoading(true);
      const widthRatio = image.width / imageLayout.width;
      const heightRatio = image.height / imageLayout.height;

      const cropData: ImageCropData = {
        offset: { x: cropX.value * widthRatio, y: cropY.value * heightRatio },
        size: { width: cropWidth.value * widthRatio, height: cropHeight.value * heightRatio },
        resizeMode: "cover",
        format: "webp",
        quality: Platform.OS === "ios" ? 0.5 : 0.9,
        includeBase64: false,
      };

      const croppedImageUri: CropResult = await ImageEditor.cropImage(image.uri, cropData);

      handleTranscription(croppedImageUri);
    } catch (error) {
      console.error("Crop Error", error);
      Toast.show({ type: "error", text1: "Erro ao processar imagem" });
    }
  };

Activity

  1. retyui commented on Oct 1, 2024

    @retyui
    Collaborator

    This bug only happen when I got a picture from react native vision camera, when picked with expo-image-picker, it works fine!

    Thank you for reporting this problem. This workaround should assist to resolve it, as we have something similar on Android.

  2. jimmydjabali commented on Jun 25, 2025

    @jimmydjabali

    @retyui Thanks for the workaround, but the issue happen on .PNG images taken from the iOS library (.HEIF works).

  3. camboYY commented on Feb 17, 2026

    @camboYY

    same issue

  4. retyui commented on Jul 13, 2026

    @retyui
    Collaborator

    This issue is stale because it has no activity.
    If there is no activity in the next 7 days, the issue will be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions