PHImageResultIsDegradedKey/PHImageFileURLKey is not found

前端 未结 9 888
忘了有多久
忘了有多久 2020-12-09 22:59

iOS 13 beta4 no longer gives

1) PHImageFileURLKey 2) PHImageResultIsDegradedKey in image result info keys.

Anyone knows a way to find the fileurl of the P

9条回答
  •  一生所求
    2020-12-09 23:42

    If anyone needs the file size when using RequestContentEditingInput in Xamarin.

    var options = new PHContentEditingInputRequestOptions();
    asset.RequestContentEditingInput(options, (PHContentEditingInput contentEditingInput, NSDictionary requestStatusInfo) =>
    {
        var imageUrl = contentEditingInput.FullSizeImageUrl.ToString();
    
        NSObject fileSizeObj;
        if (contentEditingInput.FullSizeImageUrl.TryGetResource(new NSString("NSURLFileSizeKey"), out fileSizeObj))
        {
            var fileSizeNSNum = fileSizeObj as NSNumber;
            long fileSize = fileSizeNSNum.Int64Value;
        }
    
        // Make sure to dispose or your app will crash with a lot of photos!
        contentEditingInput.Dispose();
    
    });
    

提交回复
热议问题