diff --git a/README.md b/README.md index 0427668..e7acd58 100644 --- a/README.md +++ b/README.md @@ -410,9 +410,15 @@ work by you shall be dual licensed as above, without any additional terms or con ## Version History +#### Development + +* Fix a bug when parsing images where we passed the wrong value for the type identifier hint, resulting in a warning being logged to the console ([#62][]). + +[#62]: https://github.com/postmates/PMHTTP/issues/62 "Unknown Hint Identifier for Image MIME Types · Issue #62 · postmates/PMHTTP" + #### v4.3.3 (2019-04-07) -* Updated `PMHTTPErrorIsFailedResponse` to handle `PMHTTPErrorUnexpectedNoContent` and `PMHTTPErrorUnexpectedRedirect` in addition to `PMHTTPErrorFailedResponse` and `PMHTTPErrorUnauthorized`. +* Update `PMHTTPErrorIsFailedResponse` to handle `PMHTTPErrorUnexpectedNoContent` and `PMHTTPErrorUnexpectedRedirect` in addition to `PMHTTPErrorFailedResponse` and `PMHTTPErrorUnauthorized`. * Fix warnings introduced by Xcode 10.2. #### v4.3.2 (2018-11-14) diff --git a/Sources/PlatformSpecific.swift b/Sources/PlatformSpecific.swift index ed3c614..5fdc6d1 100644 --- a/Sources/PlatformSpecific.swift +++ b/Sources/PlatformSpecific.swift @@ -376,8 +376,10 @@ import Foundation // Use CGImageSource so we can provide the MIME type hint. // NB: CGImageSource will cache the decoded image data by default on 64-bit platforms. let options: NSDictionary? - if let mimeType = mimeType { - options = [kCGImageSourceTypeIdentifierHint: mimeType as CFString] + if let mimeType = mimeType, + let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType as CFString, kUTTypeImage)?.takeRetainedValue() + { + options = [kCGImageSourceTypeIdentifierHint: uti] } else { options = nil }