mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Limit avatar photo editor processed image size
This commit is contained in:
parent
447fc13416
commit
a3fc5f5340
@ -47,6 +47,7 @@ CGSize TGPhotoEditorScreenImageMaxSize();
|
||||
|
||||
extern const CGSize TGPhotoEditorResultImageMaxSize;
|
||||
extern const CGSize TGPhotoEditorResultImageWallpaperMaxSize;
|
||||
extern const CGSize TGPhotoEditorResultImageAvatarMaxSize;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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 };
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user