From e82d911d1430e57784817d7437938eb2ccab4442 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 5 May 2021 22:28:01 +0400 Subject: [PATCH] Increase photo editor preview resolution --- Telegram/Telegram-iOS/en.lproj/Localizable.strings | 1 - .../LegacyComponents/Sources/TGPhotoCropController.m | 9 +++------ submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m | 8 ++++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 5c00e3fbed..8a56d15615 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -6447,7 +6447,6 @@ Sorry for the inconvenience."; "Checkout.SuccessfulTooltip" = "You paid %1$@ for %2$@."; - "Privacy.ContactsReset.ContactsDeleted" = "All synced contacts deleted."; "Privacy.DeleteDrafts.DraftsDeleted" = "All cloud drafts deleted."; diff --git a/submodules/LegacyComponents/Sources/TGPhotoCropController.m b/submodules/LegacyComponents/Sources/TGPhotoCropController.m index 9e497a5ed4..e64c049c3d 100644 --- a/submodules/LegacyComponents/Sources/TGPhotoCropController.m +++ b/submodules/LegacyComponents/Sources/TGPhotoCropController.m @@ -502,13 +502,10 @@ NSString * const TGPhotoCropOriginalAspectRatio = @"original"; - (id)currentResultRepresentation { - if (_transitionOutView != nil && [_transitionOutView isKindOfClass:[UIImageView class]]) - { + if (_transitionOutView != nil && [_transitionOutView isKindOfClass:[UIImageView class]]) { return ((UIImageView *)_transitionOutView).image; - } - else - { - return [_cropView croppedImageWithMaxSize:CGSizeMake(750, 750)]; + } else { + return [_cropView croppedImageWithMaxSize:TGPhotoEditorScreenImageMaxSize()]; } } diff --git a/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m b/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m index 2cadc81c9e..fd5465eefa 100644 --- a/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m +++ b/submodules/LegacyComponents/Sources/TGPhotoEditorUtils.m @@ -7,14 +7,14 @@ #import const CGSize TGPhotoEditorResultImageMaxSize = { 1280, 1280 }; -const CGSize TGPhotoEditorScreenImageHardLimitSize = { 750, 750 }; +const CGSize TGPhotoEditorScreenImageHardLimitSize = { 1280, 1280 }; +const CGSize TGPhotoEditorScreenImageHardLimitLegacySize = { 750, 750 }; CGSize TGPhotoEditorScreenImageMaxSize() { CGSize screenSize = TGScreenSize(); - CGFloat maxSide = MIN(TGPhotoEditorScreenImageHardLimitSize.width, TGScreenScaling() * MIN(screenSize.width, screenSize.height)); - - return CGSizeMake(maxSide, maxSide); + CGSize limitSize = screenSize.width == 320 ? TGPhotoEditorScreenImageHardLimitLegacySize : TGPhotoEditorScreenImageHardLimitSize; + return limitSize; } CGSize TGPhotoThumbnailSizeForCurrentScreen()