我有这个功能从资产中获取图像:
func fetchImage(asset: PhotoAsset, size: CGSize, resizeMode: ResizeMode = .Exact, completion: (result: UIImage?) -> Void) {
let photoAsset = asset as! PHAsset
var options: PHImageRequestOptions?
switch resizeMode {
case .Exact:
options = PHImageRequestOptions()
options?.resizeMode = .Exact
case .Default:
options = nil
}
manager.requestImageForAsset(
photoAsset,
targetSize: size,
contentMode: .AspectFill,
options: options
) { [weak self] result, _ in
completion(result: result)
}
}
但我如何定义以获取原始大小的图像?
谢谢!
答案 0 :(得分:12)
将...
.then((response: ng.IHttpPromiseCallbackArg<IWordRow>): any => {
self.word = angular.copy(response.data);
self['wordNgForm'].$setPristine(); // <==
...
},
用于targetSize:
PHImageManagerMaximumSize