TOCropViewController icon indicating copy to clipboard operation
TOCropViewController copied to clipboard

Fatal Exception: CALayerInvalidGeometry

Open thangpd-citigo opened this issue 5 years ago • 2 comments

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 Screen Shot 2020-10-05 at 14 26 17

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

thangpd-citigo avatar Oct 05 '20 08:10 thangpd-citigo

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. :)

TimOliver avatar Oct 11 '20 02:10 TimOliver

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 :( > 121165898_370134277462609_4717400225029190427_n 121250106_966949003772530_97212164413333529_n 121007687_418983549110121_6114561848669903386_n 121414952_2758528804370001_4006981610577242407_n

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

TOCropViewController.m Screen Shot 2020-10-12 at 10 21 30 Screen Shot 2020-10-12 at 10 21 57

TOCropView Screen Shot 2020-10-12 at 10 23 00 Screen Shot 2020-10-12 at 10 23 10

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

thangpd-citigo avatar Oct 12 '20 03:10 thangpd-citigo