From b0712522eb621737b52745e093e43a8aabb9f985 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 30 Nov 2020 09:30:21 +1100 Subject: [PATCH] Compress images a bit more --- Session/Signal/GifPickerViewController.swift | 2 +- Session/Signal/PhotoCapture.swift | 2 +- Session/Signal/PhotoLibrary.swift | 2 +- SessionShareExtension/ShareViewController.swift | 2 +- .../Attachment Approval/AttachmentApprovalViewController.swift | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Session/Signal/GifPickerViewController.swift b/Session/Signal/GifPickerViewController.swift index f5c4711f5..350ecf378 100644 --- a/Session/Signal/GifPickerViewController.swift +++ b/Session/Signal/GifPickerViewController.swift @@ -388,7 +388,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect owsFailDebug("couldn't load asset.") return } - let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: rendition.utiType, imageQuality: .original) + let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: rendition.utiType, imageQuality: .medium) strongSelf.dismiss(animated: true) { // Delegate presents view controllers, so it's important that *this* controller be dismissed before that occurs. diff --git a/Session/Signal/PhotoCapture.swift b/Session/Signal/PhotoCapture.swift index 385f4b63c..f445273e7 100644 --- a/Session/Signal/PhotoCapture.swift +++ b/Session/Signal/PhotoCapture.swift @@ -396,7 +396,7 @@ extension PhotoCapture: CaptureOutputDelegate { let dataSource = DataSourceValue.dataSource(with: photoData, utiType: kUTTypeJPEG as String) - let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: kUTTypeJPEG as String, imageQuality: .original) + let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: kUTTypeJPEG as String, imageQuality: .medium) delegate?.photoCapture(self, didFinishProcessingAttachment: attachment) } diff --git a/Session/Signal/PhotoLibrary.swift b/Session/Signal/PhotoLibrary.swift index c2a93136e..b5e011da2 100644 --- a/Session/Signal/PhotoLibrary.swift +++ b/Session/Signal/PhotoLibrary.swift @@ -207,7 +207,7 @@ class PhotoCollectionContents { switch asset.mediaType { case .image: return requestImageDataSource(for: asset).map { (dataSource: DataSource, dataUTI: String) in - return SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .original) + return SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .medium) } case .video: return requestVideoDataSource(for: asset).map { (dataSource: DataSource, dataUTI: String) in diff --git a/SessionShareExtension/ShareViewController.swift b/SessionShareExtension/ShareViewController.swift index 556df6bc7..eb1e0059c 100644 --- a/SessionShareExtension/ShareViewController.swift +++ b/SessionShareExtension/ShareViewController.swift @@ -935,7 +935,7 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed return promise } - let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: specificUTIType, imageQuality: .original) + let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: specificUTIType, imageQuality: .medium) if loadedItem.isConvertibleToContactShare { Logger.info("isConvertibleToContactShare") attachment.isConvertibleToContactShare = true diff --git a/SignalUtilitiesKit/UI/Attachment Approval/AttachmentApprovalViewController.swift b/SignalUtilitiesKit/UI/Attachment Approval/AttachmentApprovalViewController.swift index 7c06c23f3..66d0dc51e 100644 --- a/SignalUtilitiesKit/UI/Attachment Approval/AttachmentApprovalViewController.swift +++ b/SignalUtilitiesKit/UI/Attachment Approval/AttachmentApprovalViewController.swift @@ -623,7 +623,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC } dataSource.sourceFilename = filename - let dstAttachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .original) + let dstAttachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .medium) if let attachmentError = dstAttachment.error { owsFailDebug("Could not prepare attachment for output: \(attachmentError).") return attachmentItem.attachment