Skip to content
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

On IOS 18 the result of the crop is always null #53

Open
Adrien30starly opened this issue Oct 30, 2024 · 1 comment
Open

On IOS 18 the result of the crop is always null #53

Adrien30starly opened this issue Oct 30, 2024 · 1 comment

Comments

@Adrien30starly
Copy link

`
Future<CropImageResult?> _cropImageNew(File imageFile) async {
final CropImageResult? result;

if (Platform.isAndroid) {
  result = await showMaterialImageCropper(
    context,
    locale: _cropSettings.locale,
    imageProvider: FileImage(imageFile),
    cropPathFn: _cropSettings.cropShapeFn,
  );
} else {
  result = await showCupertinoImageCropper(
    context,
    locale: _cropSettings.locale,
    imageProvider: FileImage(imageFile),
    cropPathFn: _cropSettings.cropShapeFn,
  );
}

if (result != null) {
  widget.markAsUnsaved(true);
  return result;
}
setState(() {
  profileChanged = false;
});
return null;

}
`
In the above code the result will always return null on IOS 18. Android works correctly. Alson working on IOS simulator below IOS 18. I tried to catch any errors that might have happened but nothing from the logs in vs code. However I did find these logs in xcode:
Could not create a bookmark: NSError: Cocoa 4097 "connection to service named com.apple.FileProvider"
updateImageHeadroom:1309: *** ERROR: CGImageSetHeadroom: 3.008186 failed for image with kCGColorSpaceDisplayP3 color space
image_picker: compressing is not supported for type (null). Returning the image with original quality

However, it seems that these logs refer to image_picker plugin which is actually working fine even on IOS 18 so im not really sure where the problem lies

@kekland
Copy link
Owner

kekland commented Oct 31, 2024

Hm, the logs indicate that an image with kCGColorSpaceDisplayP3 color space was passed. We don't use image_picker in this package, so that seems to indicate that the error is coming from somewhere before the call to the cropper.

I'll take a look once I have time. Could you try with a standard JPEG file and see if this issue happens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants