mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-23 00:40:59 +00:00
Add more path to compressor image
This commit is contained in:
parent
f172d6d4a6
commit
0132e51509
2 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,6 @@ actor StatusEditorCompressor {
|
|||
let isPNG: Bool = {
|
||||
guard let utType = cgImage.utType else { return false }
|
||||
return (utType as String) == UTType.png.identifier
|
||||
|
||||
}()
|
||||
|
||||
let destinationProperties = [
|
||||
|
|
|
@ -68,13 +68,14 @@ enum StatusEditorUTTypeSupported: String, CaseIterable {
|
|||
} else if let transferable = await getImageTansferable(item: item) {
|
||||
return transferable
|
||||
}
|
||||
let compressor = StatusEditorCompressor()
|
||||
let result = try await item.loadItem(forTypeIdentifier: rawValue)
|
||||
if self == .jpeg || self == .png || self == .tiff || self == .image || self == .uiimage || self == .adobeRawImage {
|
||||
if let image = result as? UIImage {
|
||||
return image
|
||||
} else if let imageURL = result as? URL,
|
||||
let data = try? Data(contentsOf: imageURL),
|
||||
let image = UIImage(data: data)
|
||||
let compressedData = await compressor.compressImageFrom(url: imageURL),
|
||||
let image = UIImage(data: compressedData)
|
||||
{
|
||||
return image
|
||||
} else if let data = result as? Data,
|
||||
|
|
Loading…
Reference in a new issue