From 619fe5902784555b6947554119185f27c0742eeb Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Fri, 29 May 2020 17:42:33 +0300 Subject: [PATCH 1/2] Fix photo image crop --- submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m b/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m index f6939f32ba..02c94dc98d 100644 --- a/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m +++ b/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m @@ -267,11 +267,14 @@ UIImage *TGPhotoEditorVideoExtCrop(UIImage *inputImage, UIImage *paintingImage, if (skipImageTransform) { imageSize = CGSizeMake(image.size.width * fittedOriginalSize.width / rect.size.width, image.size.height * fittedOriginalSize.height / rect.size.height); + } else { + imageSize = image.size; } } else { image = inputImage; + imageSize = image.size; } if (skipImageTransform) { From f4f446a708745e714f0ab6fd21cb474e62238357 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Fri, 29 May 2020 17:52:25 +0300 Subject: [PATCH 2/2] Fix image rendering crash on panoramic photos --- submodules/LegacyComponents/Sources/TGPhotoEditorController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/LegacyComponents/Sources/TGPhotoEditorController.m b/submodules/LegacyComponents/Sources/TGPhotoEditorController.m index 72c3bd3dac..b20090ad9a 100644 --- a/submodules/LegacyComponents/Sources/TGPhotoEditorController.m +++ b/submodules/LegacyComponents/Sources/TGPhotoEditorController.m @@ -699,7 +699,7 @@ SSignal *renderedImageSignal = [[imageSignal mapToSignal:^SSignal *(UIImage *image) { - return [imageCropSignal(image, !hasImageAdjustments || hasPainting) startOn:_queue]; + return [imageCropSignal(image, !hasImageAdjustments || hasPainting || MAX(image.size.width, image.size.height) > 4096) startOn:_queue]; }] mapToSignal:^SSignal *(UIImage *image) { if (hasImageAdjustments)