diff --git a/Sources/InfomaniakCore/ItemProviderRepresentation/NSItemProvider+Detect.swift b/Sources/InfomaniakCore/ItemProviderRepresentation/NSItemProvider+Detect.swift index 39b222e..5b1e624 100644 --- a/Sources/InfomaniakCore/ItemProviderRepresentation/NSItemProvider+Detect.swift +++ b/Sources/InfomaniakCore/ItemProviderRepresentation/NSItemProvider+Detect.swift @@ -21,9 +21,8 @@ import InfomaniakDI /// Extending NSItemProvider for detecting file type, business logic. public extension NSItemProvider { - /// image identifiers supported by the app + /// image file identifiers supported by the app private static let imageUTIIdentifiers = [ - UTI.image.identifier, UTI.jpeg.identifier, UTI.tiff.identifier, UTI.gif.identifier, @@ -87,13 +86,13 @@ public extension NSItemProvider { return .isText } else if hasItemConformingToAnyOfTypeIdentifiers(Self.imageUTIIdentifiers) { return .isImageData + } else if registeredTypeIdentifiers.count == 1 && + registeredTypeIdentifiers.first == UTI.image.identifier { + return .isUIImage } else if hasItemConformingToAnyOfTypeIdentifiers(Self.directoryUTIIdentifiers) { return .isDirectory } else if hasItemConformingToAnyOfTypeIdentifiers(Self.compressedUTIIdentifiers) { return .isCompressedData(identifier: typeIdentifier) - } else if registeredTypeIdentifiers.count == 1 && - registeredTypeIdentifiers.first == UTI.image.identifier { - return .isUIImage } else { return .isMiscellaneous(identifier: typeIdentifier) } diff --git a/Sources/InfomaniakCore/ItemProviderRepresentation/UTI.swift b/Sources/InfomaniakCore/ItemProviderRepresentation/UTI.swift index e9fb271..2984c53 100644 --- a/Sources/InfomaniakCore/ItemProviderRepresentation/UTI.swift +++ b/Sources/InfomaniakCore/ItemProviderRepresentation/UTI.swift @@ -311,6 +311,7 @@ public struct UTI: RawRepresentable { public static let webArchive = UTI(rawValue: kUTTypeWebArchive) + /// Typical for UIImage public static let image = UTI(rawValue: kUTTypeImage) public static let jpeg = UTI(rawValue: kUTTypeJPEG)