Browse Source

Revert "improve attachment image quality"

This reverts commit ad4e65e6e1.
pull/513/head
ryanzhao 2 months ago
parent
commit
b315510ec2
  1. 2
      Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift
  2. 2
      Session/Media Viewing & Editing/PhotoCapture.swift
  3. 2
      Session/Media Viewing & Editing/PhotoLibrary.swift
  4. 3
      SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift
  5. 2
      SessionShareExtension/ShareVC.swift
  6. 2
      SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift

2
Session/Media Viewing & Editing/GIFs/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: .high)
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.

2
Session/Media Viewing & Editing/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: .high)
let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: kUTTypeJPEG as String, imageQuality: .medium)
delegate?.photoCapture(self, didFinishProcessingAttachment: attachment)
}

2
Session/Media Viewing & Editing/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: .high)
return SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .medium)
}
case .video:
return requestVideoDataSource(for: asset).map { (dataSource: DataSource, dataUTI: String) in

3
SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift

@ -75,7 +75,6 @@ public enum TSImageQualityTier: UInt {
@objc
public enum TSImageQuality: UInt {
case original
case high
case medium
case compact
@ -83,8 +82,6 @@ public enum TSImageQuality: UInt {
switch self {
case .original:
return .original
case .high:
return .high
case .medium:
return .mediumHigh
case .compact:

2
SessionShareExtension/ShareVC.swift

@ -552,7 +552,7 @@ final class ShareVC : UINavigationController, ShareViewDelegate, AppModeManagerD
return promise
}
let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: specificUTIType, imageQuality: .high)
let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: specificUTIType, imageQuality: .medium)
if loadedItem.isConvertibleToContactShare {
Logger.info("isConvertibleToContactShare")
attachment.isConvertibleToContactShare = true

2
SignalUtilitiesKit/Media Viewing & Editing/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: .high)
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

Loading…
Cancel
Save