Use original data for gifs

This commit is contained in:
Justin Mazzocchi 2021-01-08 10:06:21 -08:00
parent 4426f84df4
commit 11f43c3df5
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
1 changed files with 2 additions and 3 deletions

View File

@ -14,7 +14,7 @@ enum MediaProcessingError: Error {
case unableToCreateImageDataDestination
}
public struct MediaProcessingService {}
public enum MediaProcessingService {}
public extension MediaProcessingService {
static func dataAndMimeType(itemProvider: NSItemProvider) -> AnyPublisher<(data: Data, mimeType: String), Error> {
@ -34,7 +34,7 @@ public extension MediaProcessingService {
if let error = error {
promise(.failure(error))
} else if let url = url {
if uniformType.conforms(to: .image) {
if uniformType.conforms(to: .image) && uniformType != .gif {
promise(imageData(url: url, type: uniformType))
} else {
promise(Result { try Data(contentsOf: url) })
@ -50,7 +50,6 @@ public extension MediaProcessingService {
}
private extension MediaProcessingService {
static let uploadableMimeTypes = Set(
[UTType.png,
UTType.jpeg,