Crop result wrong on iOS 16.3
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- ios, javascript, react-native
- Domain
- mobile
Research direction
Start at the handlePress entry point and its ImageEditor.cropImage call, then compare the image URI produced by react-native-vision-camera with one from expo-image-picker on the listed iOS environment. Reproduce the crop using the provided ratios and crop data; done means the result matches the selected area on iOS without regressing the other platforms.
Written by the indexing model from the issue text.
Description
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
https://github.com/user-attachments/assets/ab1b5711-82ed-4dcc-88b7-6cec8b45e4f8
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" });
}
};
- Dominant language
- Kotlin
- Stars
- 447
- Forks
- 118
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/react-native-image-editor
-
Security: vulnerable dependency image-size (CVE-2025-71329/71330) — maintained drop-in available Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
All issues in callstack/react-native-image-editor
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
libre-tube/LibreTube#8803 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Telegram !!! Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Xposed-Modules-Repo/com.fuck.iab#24 · 3 comments · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
SimonHalvdansson/Harmonic-HN#361 ·