Skip to content

Commit

Permalink
Merge pull request hyperoslo#207 from hyperoslo/fix/asset
Browse files Browse the repository at this point in the history
Fix asset
  • Loading branch information
zenangst authored Sep 22, 2016
2 parents 5b74792 + 35ae57b commit f6e5855
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Source/AssetManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ public class AssetManager {
public static func resolveAsset(asset: PHAsset, size: CGSize = CGSize(width: 720, height: 1280), completion: (image: UIImage?) -> Void) {
let imageManager = PHImageManager.defaultManager()
let requestOptions = PHImageRequestOptions()
requestOptions.deliveryMode = .HighQualityFormat

imageManager.requestImageForAsset(asset, targetSize: size, contentMode: .AspectFill, options: requestOptions) { image, info in
if let info = info where info["PHImageFileUTIKey"] == nil {
if let info = info {
dispatch_async(dispatch_get_main_queue(), {
completion(image: image)
})
Expand Down
2 changes: 1 addition & 1 deletion Source/ImageGallery/ImageGalleryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ extension ImageGalleryView: UICollectionViewDelegate {

let asset = assets[indexPath.row]

AssetManager.resolveAsset(asset) { image in
AssetManager.resolveAsset(asset, size: CGSize(width: 100, height: 100)) { image in
guard let _ = image else { return }

if cell.selectedImageView.image != nil {
Expand Down

0 comments on commit f6e5855

Please sign in to comment.