diff --git a/submodules/LegacyComponents/PublicHeaders/LegacyComponents/TGPhotoEditorUtils.h b/submodules/LegacyComponents/PublicHeaders/LegacyComponents/TGPhotoEditorUtils.h index 86a85c0067..d63003e1e7 100644 --- a/submodules/LegacyComponents/PublicHeaders/LegacyComponents/TGPhotoEditorUtils.h +++ b/submodules/LegacyComponents/PublicHeaders/LegacyComponents/TGPhotoEditorUtils.h @@ -47,6 +47,7 @@ CGSize TGPhotoEditorScreenImageMaxSize(); extern const CGSize TGPhotoEditorResultImageMaxSize; extern const CGSize TGPhotoEditorResultImageWallpaperMaxSize; +extern const CGSize TGPhotoEditorResultImageAvatarMaxSize; #ifdef __cplusplus } diff --git a/submodules/LegacyComponents/Sources/TGPhotoEditorController.m b/submodules/LegacyComponents/Sources/TGPhotoEditorController.m index 7b296a5ff6..8ca9315893 100644 --- a/submodules/LegacyComponents/Sources/TGPhotoEditorController.m +++ b/submodules/LegacyComponents/Sources/TGPhotoEditorController.m @@ -498,7 +498,7 @@ }] map:^UIImage *(UIImage *image) { if (avatar) { - CGFloat maxSide = [GPUImageContext maximumTextureSizeForThisDevice]; + CGFloat maxSide = MIN(TGPhotoEditorResultImageAvatarMaxSize.width, [GPUImageContext maximumTextureSizeForThisDevice]); if (MAX(image.size.width, image.size.height) > maxSide) { CGSize fittedSize = TGScaleToFit(image.size, CGSizeMake(maxSide, maxSide)); return TGScaleImageToPixelSize(image, fittedSize); diff --git a/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m b/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m index 949bb0b510..ec3e9d2888 100644 --- a/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m +++ b/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m @@ -8,6 +8,7 @@ const CGSize TGPhotoEditorResultImageMaxSize = { 1280, 1280 }; const CGSize TGPhotoEditorResultImageWallpaperMaxSize = { 2048, 2048 }; +const CGSize TGPhotoEditorResultImageAvatarMaxSize = { 2048, 2048 }; const CGSize TGPhotoEditorScreenImageHardLimitSize = { 1280, 1280 }; const CGSize TGPhotoEditorScreenImageHardLimitLegacySize = { 750, 750 };