X-Git-Url: https://git.r.bdr.sh/rbdr/captura/blobdiff_plain/e42019cd38b59e757f6036b132614a471d4cf6fe..9431168da5eb1338d8c9fc8cc92e6245c539e73d:/Captura/CapturaApp.swift?ds=inline diff --git a/Captura/CapturaApp.swift b/Captura/CapturaApp.swift index 2136d72..67709a5 100644 --- a/Captura/CapturaApp.swift +++ b/Captura/CapturaApp.swift @@ -1,5 +1,4 @@ import SwiftUI -import SwiftData import Cocoa import Combine import AVFoundation @@ -327,7 +326,10 @@ struct CapturaApp: App { if now - gifCallbackTimer > .nanoseconds(1_000_000_000 / UInt64(captureSessionConfiguration.frameRate)) { gifCallbackTimer = now DispatchQueue.main.async { - if let cgImage = frame.cgImage?.resize(by: self.pixelDensity) { + if var cgImage = frame.cgImage { + if self.pixelDensity > 1 { + cgImage = cgImage.resize(by: self.pixelDensity) ?? cgImage + } self.images.append(cgImage) } }