Kaynağa Gözat

proraw photo uploading support

Signed-off-by: zcw159357 <zcw159357@gmail.com>
zcw159357 3 yıl önce
ebeveyn
işleme
d65ab1df28
1 değiştirilmiş dosya ile 16 ekleme ve 0 silme
  1. 16 0
      iOSClient/Utility/CCUtility.m

+ 16 - 0
iOSClient/Utility/CCUtility.m

@@ -1410,6 +1410,22 @@
                     metadata.ext = @"jpg";
                 }
                 
+                if ([extensionAsset isEqualToString:@"DNG"]) {
+                    if ([CCUtility getFormatCompatibility]) {
+                        NSString *fileNameJPEG = [[metadata.fileName lastPathComponent] stringByDeletingPathExtension];
+                        fileName = [fileNameJPEG stringByAppendingString:@".jpg"];
+                        metadata.contentType = @"image/jpeg";
+                        metadata.ext = @"jpg";
+                    } else {
+                        NSArray *resources = [PHAssetResource assetResourcesForAsset:asset];
+                        if (resources.count > 0) {
+                            PHAssetResource *assetResource = resources[0];
+                            NSURL *fileURL = [assetResource valueForKey:@"privateFileURL"];
+                            imageData = [NSData dataWithContentsOfURL:fileURL];
+                        }
+                    }
+                }
+                
                 NSString *fileNamePath = [NSTemporaryDirectory() stringByAppendingString:fileName];
                 
                 [[NSFileManager defaultManager]removeItemAtPath:fileNamePath error:nil];