Fixed a camera bug and minor optimisation

• Fixed an issue with portrait photo orientation
• Fixed a project config which would prevent debugging the framework targets properly
• Tweaked an unneeded icon resize
pull/988/head
Morgan Pretty 8 months ago
parent bef27ee0c7
commit b3d90df15e

@ -6649,6 +6649,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.ShareExtension";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
STRIP_INSTALLED_PRODUCT = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -6780,6 +6781,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.NotificationServiceExtension";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
STRIP_INSTALLED_PRODUCT = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
@ -6912,6 +6914,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.SessionUIKit";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
STRIP_INSTALLED_PRODUCT = NO;
SUPPORTS_MACCATALYST = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -7378,6 +7381,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.SessionUtilitiesKit";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
STRIP_INSTALLED_PRODUCT = NO;
SUPPORTS_MACCATALYST = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_INCLUDE_PATHS = "$(inherited) \"$(TARGET_BUILD_DIR)/libSessionUtil\"";

@ -56,12 +56,11 @@ final class ReactionContainerView: UIView {
lazy var collapseButton: UIView = {
let arrow: UIImageView = UIImageView(
image: UIImage(named: "ic_chevron_up")?
.resized(to: ReactionContainerView.arrowSize)?
.withRenderingMode(.alwaysTemplate)
image: UIImage(named: "ic_chevron_up")?.withRenderingMode(.alwaysTemplate)
)
arrow.themeTintColor = .textPrimary
arrow.setContentHuggingPriority(.required, for: .horizontal)
arrow.set(.width, to: ReactionContainerView.arrowSize.width)
arrow.set(.height, to: ReactionContainerView.arrowSize.height)
let textLabel: UILabel = UILabel()
textLabel.setContentHuggingPriority(.required, for: .vertical)

@ -4,10 +4,7 @@ import UIKit.UIImage
public extension UIImage {
func normalizedImage() -> UIImage {
guard
let imgRef: CGImage = self.cgImage,
imageOrientation != .up
else { return self }
guard imageOrientation != .up else { return self }
// The actual resize: draw the image on a new context, applying a transform matrix
let bounds: CGRect = CGRect(x: 0, y: 0, width: size.width, height: size.height)
@ -15,10 +12,10 @@ public extension UIImage {
format.scale = self.scale
format.opaque = false
let renderer: UIGraphicsImageRenderer = UIGraphicsImageRenderer(bounds: bounds, format: format)
return renderer.image { rendererContext in
rendererContext.cgContext.draw(imgRef, in: bounds, byTiling: false)
// Note: We use the UIImage.draw function here instead of using the CGContext because UIImage
// automatically deals with orientations so we don't have to
return UIGraphicsImageRenderer(bounds: bounds, format: format).image { _ in
self.draw(in: bounds)
}
}

Loading…
Cancel
Save