TOCropViewController
TOCropViewController copied to clipboard
Fatal Exception: CALayerInvalidGeometry
Describe the bug It's a sometime bugs, just few users got crash when open TOCropViewController I got the crash log in my console firebase crashlytics.
Steps to reproduce the behavior: when user chose an image from library and i open it in TOCropViewController Here are the code
for (PHAsset *asset in assets) {
[[PHImageManager defaultManager] requestImageForAsset:asset targetSize:PHImageManagerMaximumSize contentMode:PHImageContentModeDefault options:requestOption resultHandler:^(UIImage * _Nullable image, NSDictionary * _Nullable info) {
// Trường hợp chỉ chọn 1 ảnh
if (assets.count == 1) {
[self dismissViewControllerAnimated:YES completion:^{
[self openCropImageControllerWithImage:image];
}];
return;
}
[self handleImageCellDataWithNewImage:image];
}];
}
- (void)openCropImageControllerWithImage:(UIImage *)image {
TOCropViewController *cropController = [[TOCropViewController alloc] initWithCroppingStyle:TOCropViewCroppingStyleDefault image:image];
cropController.modalPresentationStyle = UIModalPresentationFullScreen;
cropController.delegate = self;
[self presentViewController:cropController animated:YES completion:nil];
}
Here are log for crash

iOS Device:
- Device: [e.g. iPhone7 Plus]
- OS: [e.g. iOS13.7]
- Library Version [2.5.4]
Additional context I'm so sorry for the inconvenience, could you please help me with this issue ! Many thanks
Uhh, sorry @thangpd-citigo you're having that issue, but I'm not sure what I can do to help there. Are you able to get more debug information to see which line of code in particular in TOCropViewController is causing the issue?
I've tried to attach as much error handling as I can for images that for some reason might have invalid dimensions, but somehow these issues keep happening. If it could be possible to get ahold of one of those images, that would help a lot. :)
Thanks @TimOliver for your response !
The image i got is just a normal image and here they are < The user send it to me but i just can't reproduce the crash :( >

As the crashlog said here is what i think it went through
TOCropViewController.m

TOCropView

Everything run smoothly on our devices and just a few user got this crash! sorry for bothering you!