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) 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) {