Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pro Photo Upload Settings #759

Merged
merged 54 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2a2ad2f
Started implementing EXIF metadata viewer
Jul 1, 2020
1f74d6f
Conversion of APEX units. EXIF AUX section
Jul 2, 2020
8ba636d
Added histogram created with CoreImage
Jul 2, 2020
464f20b
Using more appropriate image creation method
Jul 6, 2020
dbabfbf
Added GPS location parsing / presentation
Jul 6, 2020
1eaa6f9
Made image details formatting more compact
Jul 6, 2020
3f72d49
Added header with image thumbnail, file size info
Jul 9, 2020
324b896
Added TIFF meta-data
Jul 9, 2020
06950ec
Merge branch 'milestone/1.4' into exif_metadata
hosy Jul 9, 2020
6fed7a3
Added TIFF:PhotometricInterpretation mapping
Jul 9, 2020
47b6427
Merge branch 'exif_metadata' of https://github.com/owncloud/ios-app i…
Jul 9, 2020
0d6668b
Small fixes in the EXIF meta data view
Jul 10, 2020
adbb541
Moved GPS data to the top, improved exposure bias formatting
Jul 10, 2020
108cd44
few text formatting fixes
Jul 13, 2020
b5d8f45
Layout changes to make metadata view look nicer on iPad
Jul 15, 2020
1dd8f28
Pro photo features configured as IAP
Jul 15, 2020
dc066ad
Localization changes
Jul 16, 2020
66b514c
Fixed wrong text formatting
Jul 21, 2020
1c947e1
Merge remote-tracking branch 'origin/exif_metadata' into pro_photo_fe…
Jul 24, 2020
22c9e2f
Started implemented pro photo upload settings
Jul 24, 2020
5738b9b
Added extended photo upload settings
Jul 24, 2020
9999dd8
First functioning implementation
Jul 27, 2020
b7dcd64
Fixed issue with image preview rotation
Jul 27, 2020
c7fce7c
Fixed rotation issue in image preview
Jul 27, 2020
003f8a6
Fixed incorrect image dimensions in case of RAW photo
Jul 27, 2020
2cf65e9
Added a RAW photo badge in photo picker
Jul 29, 2020
a5390a7
Added ‘Pro Photo’ IAP as a single purchasable product
Jul 31, 2020
4a98944
Merge remote-tracking branch 'origin/exif_metadata' into feature/pro_…
Jul 31, 2020
6e0d621
Changed wording and added localized strings
Jul 31, 2020
3cdc037
Check user eligibility for using pro photo upload features
Aug 3, 2020
4c50d61
Fixed code review findings
Aug 4, 2020
a1bda90
Fixed review findings
Aug 26, 2020
86f84b7
Changed app store IAP identifier for Pro Photo package
Aug 26, 2020
c925dc0
Merge branch 'milestone/11.4.1' into exif_metadata
Aug 31, 2020
de59ce4
Update oC SDK
Aug 31, 2020
6f54fb1
Fixed issues with previously merged code not buildable
Sep 1, 2020
a889496
Merge remote-tracking branch 'origin/milestone/11.4.1' into exif_meta…
Sep 13, 2020
e2d1992
Merge remote-tracking branch 'origin/milestone/11.4.1' into feature/p…
Sep 13, 2020
c8eb89d
Updated oc SDK
Sep 13, 2020
905f485
Merged latest changes and made branch buildable again
Sep 13, 2020
2eb113c
Merge remote-tracking branch 'origin/exif_metadata' into feature/pro_…
Sep 13, 2020
3dca155
Merge remote-tracking branch 'origin/milestone/11.4.1' into feature/p…
felix-schwarz Sep 15, 2020
42eba22
- revert reverted changes in ownCloud File Provider/OCItem+FileProvid…
felix-schwarz Sep 15, 2020
e8ca954
- revert logging-related reverts performed by 72c2d80aef726f9a18a97cc…
felix-schwarz Sep 15, 2020
f07b9bb
- revert bugfix removal originating from 905f485
felix-schwarz Sep 15, 2020
06a5948
Avoid recomputing badge images used in table view cells
Sep 16, 2020
3364b13
Corrected review findings
Sep 16, 2020
a8381af
Fixed latest review findings
Sep 17, 2020
325a8e3
Made code more reliable in terms of reacting to account changes in a …
Sep 18, 2020
0112183
Merge remote-tracking branch 'origin/milestone/11.4.1' into feature/p…
Sep 23, 2020
706c7dc
Changed the logic how photo resource is chosen for export
Sep 23, 2020
5dfcb12
More robust detection of RAW assets
Sep 23, 2020
612fe29
Don’t show prefer RAW option if there is no camera on board which wou…
Sep 23, 2020
c17fc0c
Fixed compilation issues with Xcode 11.7
Sep 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ownCloud File Provider/OCItem+FileProviderItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ - (NSString *)filename

@"mindnode" : @"com.mindnode.mindnode.mindmap",
@"itmz" : @"com.toketaware.uti.ithoughts.itmz",

@"pdf" : @"com.adobe.pdf"
};
});
Expand Down
12 changes: 12 additions & 0 deletions ownCloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
02072E6023E46022006548A7 /* UIWindow+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02072E5F23E46022006548A7 /* UIWindow+Extension.swift */; };
0233F45E246E9D960095A799 /* UploadCameraMediaAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0233F45D246E9D960095A799 /* UploadCameraMediaAction.swift */; };
025F063324AA163C009D8FC5 /* DisplayExifMetadataAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025F063224AA163C009D8FC5 /* DisplayExifMetadataAction.swift */; };
025F063A24AA18C7009D8FC5 /* ImageMetadataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025F063924AA18C7009D8FC5 /* ImageMetadataViewController.swift */; };
024F3A2124A3AB410083E11E /* CrashReporter in Frameworks */ = {isa = PBXBuildFile; productRef = 024F3A2024A3AB410083E11E /* CrashReporter */; };
025FC720247810AB009307A7 /* MediaUploadSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025FC71F247810AB009307A7 /* MediaUploadSettingsViewController.swift */; };
025FC7272478123E009307A7 /* MediaExportSettingsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025FC7262478123E009307A7 /* MediaExportSettingsSection.swift */; };
Expand All @@ -21,6 +23,10 @@
02633EFF2483D2EB00B5F58F /* UNUserNotificationCenter+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02633EFE2483D2EB00B5F58F /* UNUserNotificationCenter+Extensions.swift */; };
0269F589244DED02002E9D99 /* UIAlertController+UniversalLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0269F588244DED02002E9D99 /* UIAlertController+UniversalLinks.swift */; };
0287DD7D249131E000C912CA /* AppStatistics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0287DD7C249131E000C912CA /* AppStatistics.swift */; };
02DC7C9024CB354800DCB2C6 /* ProPhotoUploadSettingsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02DC7C8F24CB354800DCB2C6 /* ProPhotoUploadSettingsSection.swift */; };
2308F94321467F6200CF0B91 /* ClientDirectoryPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2308F93C21467F6200CF0B91 /* ClientDirectoryPickerViewController.swift */; };
232B01F42126B0CE00366FA0 /* MoreViewHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 232B01F32126B0CE00366FA0 /* MoreViewHeader.swift */; };
232B01F62126B10900366FA0 /* MoreStaticTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 232B01F52126B10900366FA0 /* MoreStaticTableViewController.swift */; };
02AE32E424D2FA8B00A19476 /* CrashReporter in Frameworks */ = {isa = PBXBuildFile; productRef = 02AE32E324D2FA8B00A19476 /* CrashReporter */; };
02F2891424BFAF0100E3D35C /* MigrationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02F2891024BFAF0100E3D35C /* MigrationViewController.swift */; };
02F2891524BFAF0100E3D35C /* Migration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02F2891124BFAF0100E3D35C /* Migration.swift */; };
Expand Down Expand Up @@ -872,6 +878,8 @@
/* Begin PBXFileReference section */
02072E5F23E46022006548A7 /* UIWindow+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIWindow+Extension.swift"; sourceTree = "<group>"; };
0233F45D246E9D960095A799 /* UploadCameraMediaAction.swift */ = {isa = PBXFileReference; indentWidth = 5; lastKnownFileType = sourcecode.swift; path = UploadCameraMediaAction.swift; sourceTree = "<group>"; };
025F063224AA163C009D8FC5 /* DisplayExifMetadataAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayExifMetadataAction.swift; sourceTree = "<group>"; };
025F063924AA18C7009D8FC5 /* ImageMetadataViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageMetadataViewController.swift; sourceTree = "<group>"; };
025FC71F247810AB009307A7 /* MediaUploadSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaUploadSettingsViewController.swift; sourceTree = "<group>"; };
025FC7262478123E009307A7 /* MediaExportSettingsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaExportSettingsSection.swift; sourceTree = "<group>"; };
025FC72824781659009307A7 /* AutoUploadSettingsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoUploadSettingsSection.swift; sourceTree = "<group>"; };
Expand All @@ -883,6 +891,7 @@
02633EFE2483D2EB00B5F58F /* UNUserNotificationCenter+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UNUserNotificationCenter+Extensions.swift"; sourceTree = "<group>"; };
0269F588244DED02002E9D99 /* UIAlertController+UniversalLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIAlertController+UniversalLinks.swift"; sourceTree = "<group>"; };
0287DD7C249131E000C912CA /* AppStatistics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppStatistics.swift; sourceTree = "<group>"; };
02DC7C8F24CB354800DCB2C6 /* ProPhotoUploadSettingsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProPhotoUploadSettingsSection.swift; sourceTree = "<group>"; };
02F2890F24BFAF0100E3D35C /* LegacyCredentials.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LegacyCredentials.swift; sourceTree = "<group>"; };
02F2891024BFAF0100E3D35C /* MigrationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MigrationViewController.swift; sourceTree = "<group>"; };
02F2891124BFAF0100E3D35C /* Migration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Migration.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2887,6 +2896,7 @@
025FC71F247810AB009307A7 /* MediaUploadSettingsViewController.swift */,
025FC7262478123E009307A7 /* MediaExportSettingsSection.swift */,
025FC72824781659009307A7 /* AutoUploadSettingsSection.swift */,
02DC7C8F24CB354800DCB2C6 /* ProPhotoUploadSettingsSection.swift */,
025FC744247EF0F1009307A7 /* BackgroundUploadsSettingsSection.swift */,
);
path = Settings;
Expand Down Expand Up @@ -3826,6 +3836,7 @@
39CD755423D8392D00193950 /* EditDocumentViewController.swift in Sources */,
025F063A24AA18C7009D8FC5 /* ImageMetadataViewController.swift in Sources */,
DCB44D87218718BA00DAA4CC /* VendorServices.swift in Sources */,
39C31F9722F1C52C0023923D /* ThemeProvider.swift in Sources */,
39E98B3E22797D1B009911F1 /* PublicLinkTableViewController.swift in Sources */,
DC63208521FCEBE9007EC0A8 /* ClientActivityCell.swift in Sources */,
DC62514A225CEB4300736874 /* UploadMediaAction.swift in Sources */,
Expand Down Expand Up @@ -3913,6 +3924,7 @@
4C464BF22187AF1500D30602 /* PDFSearchViewController.swift in Sources */,
DC3393A422E0A75C00DD3DA4 /* ClientItemResolvingCell.swift in Sources */,
DC29F09522976B9300F77349 /* LibrarySharesTableViewController.swift in Sources */,
02DC7C9024CB354800DCB2C6 /* ProPhotoUploadSettingsSection.swift in Sources */,
DCC832F6242CC5F700153F8C /* CardIssueMessagePresenter.swift in Sources */,
DCD1301123A23F4E00255779 /* OCLicenseManager+AppStore.swift in Sources */,
DC1B2707209CF0D3004715E1 /* IssuesDismissalAnimator.swift in Sources */,
Expand Down
57 changes: 35 additions & 22 deletions ownCloud/Client/PhotoSelectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,40 @@ typealias PhotosSelectedCallback = ([PHAsset]) -> Void
class PhotoSelectionViewController: UICollectionViewController, Themeable {

// MARK: - Constants
fileprivate let thumbnailSizeMultiplier: CGFloat = 0.205
fileprivate let verticalInset: CGFloat = 1.0
fileprivate let horizontalInset: CGFloat = 1.0
fileprivate let itemSpacing: CGFloat = 1.0
fileprivate let thumbnailMaxWidthPad: CGFloat = 120.0
fileprivate let thumbnailMaxWidthPhone: CGFloat = 80.0
private let thumbnailSizeMultiplier: CGFloat = 0.205
private let verticalInset: CGFloat = 1.0
private let horizontalInset: CGFloat = 1.0
private let itemSpacing: CGFloat = 1.0
private let thumbnailMaxWidthPad: CGFloat = 120.0
private let thumbnailMaxWidthPhone: CGFloat = 80.0

// MARK: - Instance variables
var fetchResult: PHFetchResult<PHAsset>!
var assetCollection: PHAssetCollection?
var availableWidth: CGFloat = 0
var selectionCallback: PhotosSelectedCallback?
private var fetchResult: PHFetchResult<PHAsset>!
private var availableWidth: CGFloat = 0

private var thumbnailSize: CGSize!
private var previousPreheatRect = CGRect.zero
private var thumbnailWidth: CGFloat = 80.0

private let imageManager = PHCachingImageManager()
private let layout = UICollectionViewFlowLayout()
private lazy var durationFormatter = DateComponentsFormatter()
private var uploadButtonItem: UIBarButtonItem?

private lazy var rawBadgeImage: UIImage? = {
UIImage(named: "raw-badge")?.withRenderingMode(.alwaysTemplate).tinted(with: UIColor.white)
}()

fileprivate var thumbnailSize: CGSize!
fileprivate var previousPreheatRect = CGRect.zero
fileprivate var thumbnailWidth: CGFloat = 80.0
private lazy var cameraBadgeImage: UIImage? = {
UIImage(named: "camera-badge")?.withRenderingMode(.alwaysTemplate).tinted(with: UIColor.white)
}()

fileprivate let imageManager = PHCachingImageManager()
fileprivate let layout = UICollectionViewFlowLayout()
fileprivate lazy var durationFormatter = DateComponentsFormatter()
fileprivate var uploadButtonItem: UIBarButtonItem?
private lazy var livePhotoBadgeImage: UIImage = {
PHLivePhotoView.livePhotoBadgeImage(options: .overContent)
}()

var assetCollection: PHAssetCollection?
var selectionCallback: PhotosSelectedCallback?

public var focussedIndexPath: IndexPath? {
didSet {
Expand Down Expand Up @@ -240,12 +253,12 @@ class PhotoSelectionViewController: UICollectionViewController, Themeable {

// Add a badge to the cell if the PHAsset represents a Live Photo.
if asset.mediaSubtypes.contains(.photoLive) {
cell.mediaBadgeImage = PHLivePhotoView.livePhotoBadgeImage(options: .overContent)
}

if asset.mediaType == .video {
cell.mediaBadgeImage = livePhotoBadgeImage
} else if asset.mediaType == .video {
cell.videoDurationLabel.text = durationFormatter.string(from: asset.duration)
cell.mediaBadgeImage = UIImage(named: "camera-badge")?.withRenderingMode(.alwaysTemplate).tinted(with: UIColor.white)
cell.mediaBadgeImage = cameraBadgeImage
} else if PHAssetResource.assetResources(for: asset).filter({$0.type == .alternatePhoto}).count > 0 {
cell.mediaBadgeImage = rawBadgeImage
}

// Request an image for the asset from the PHCachingImageManager.
Expand Down
17 changes: 16 additions & 1 deletion ownCloud/Media Uploads/MediaUploadOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class MediaUploadOperation : Operation {
// Determine the list of preferred media formats
var utisToConvert = [String]()
var preserveOriginalNames = false
var preferredResourceTypes = [PHAssetResourceType]()

if let userDefaults = OCAppIdentity.shared.userDefaults {
if userDefaults.convertHeic {
Expand All @@ -165,9 +166,23 @@ class MediaUploadOperation : Operation {
utisToConvert.append(AVFileType.mov.rawValue)
}
preserveOriginalNames = userDefaults.preserveOriginalMediaFileNames

if userDefaults.preferOriginalPhotos {
preferredResourceTypes.append(.photo)
}

if userDefaults.preferRawPhotos {
preferredResourceTypes.append(.alternatePhoto)
}
}

if let result = asset.upload(with: core, at: rootItem, utisToConvert: utisToConvert, preserveOriginalName: preserveOriginalNames, progressHandler: nil, uploadCompleteHandler: {
if let result = asset.upload(with: core,
at: rootItem,
utisToConvert: utisToConvert,
preferredResourceTypes: preferredResourceTypes,
preserveOriginalName: preserveOriginalNames,
progressHandler: nil,
uploadCompleteHandler: {
uploadCompletion()
}) {
if let error = result.1 {
Expand Down
45 changes: 33 additions & 12 deletions ownCloud/Media Uploads/PhotoKit Extensions/PHAsset+Upload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extension PHAssetResource {
ext = "m4v"
case String(kUTTypeTIFF):
ext = "tiff"
case String(kUTTypeRawImage):
case String(kUTTypeRawImage), AVFileType.dng.rawValue:
ext = "dng"
default:
break
Expand Down Expand Up @@ -225,15 +225,27 @@ extension PHAsset {
- parameter resources: array of PHAssetResource objects belonging to PHAsset
- parameter fileName: name for the exported asset including file extension
- parameter utisToConvert: list of file UTIs for image formats which shall be converted to JPEG format
- parameter preferredResourceTypes: list of resource types which shall be preferrably exported
- parameter completionHandler: called when the file is written to disk or if an error occurs
*/
func exportPhoto(resources:[PHAssetResource], fileName:String, utisToConvert:[String] = [], completionHandler: @escaping (_ url:URL?, _ error:Error?) -> Void) {
func exportPhoto(resources:[PHAssetResource],
fileName:String,
utisToConvert:[String] = [],
preferredResourceTypes:[PHAssetResourceType] = [],
completionHandler: @escaping (_ url:URL?, _ error:Error?) -> Void) {

var resourceToExport:PHAssetResource?
var outError: Error?

// For edited photo pick the edited version
resourceToExport = resources.filter({$0.type == .fullSizePhoto}).first
// Is there a preferred export type
if preferredResourceTypes.count > 0 {
resourceToExport = resources.filter({preferredResourceTypes.contains($0.type)}).first
}

if resourceToExport == nil {
// For edited photo pick the edited version
resourceToExport = resources.filter({$0.type == .fullSizePhoto}).first
}

// If edited photo is not avaialable, pick the original
if resourceToExport == nil {
Expand All @@ -253,8 +265,8 @@ extension PHAsset {
// Prepare export URL and remove path extension which will depend on output format
var exportURL = URL(fileURLWithPath:NSTemporaryDirectory()).appendingPathComponent(fileName).deletingPathExtension()

// Check if conversion is required?
if utisToConvert.contains(resource.uniformTypeIdentifier) {
// Check if conversion is required? Don't convert RAW though
if utisToConvert.contains(resource.uniformTypeIdentifier) && resource.type != .alternatePhoto {

// Since conversion to JPEG is desired, we have first to get the actual data
var assetData = Data()
Expand Down Expand Up @@ -417,14 +429,19 @@ extension PHAsset {

- parameter fileName: name for the exported asset including file extension
- parameter utisToConvert: list of file UTIs for media formats which shall be converted
- parameter preferredResourceTypes: list of resource types which shall be preferrably exported
- parameter completion: called when the file is written to disk or if an error occurs
*/
func export(fileName:String, utisToConvert:[String] = [], completion:@escaping (_ url:URL?, _ error:Error?) -> Void) {
func export(fileName:String, utisToConvert:[String] = [], preferredResourceTypes:[PHAssetResourceType] = [], completion:@escaping (_ url:URL?, _ error:Error?) -> Void) {
let assetResources = PHAssetResource.assetResources(for: self)
if assetResources.count > 0 {
// We have actual data on the device and we can export it directly
if self.mediaType == .image {
exportPhoto(resources: assetResources, fileName: fileName, utisToConvert: utisToConvert, completionHandler: { (url, error) in
exportPhoto(resources: assetResources,
fileName: fileName,
utisToConvert: utisToConvert,
preferredResourceTypes: preferredResourceTypes,
completionHandler: { (url, error) in
completion(url, error)
})
} else if self.mediaType == .video {
Expand All @@ -437,11 +454,14 @@ extension PHAsset {
} else {
// It could be that we don't have any asset resources locally e.g. since we have to deal with an asset from a cloud album
if self.mediaType == .image {
exportPhoto(fileName: fileName, utisToConvert: utisToConvert, completionHandler: { (url, error) in
exportPhoto(fileName: fileName,
utisToConvert: utisToConvert,
completionHandler: { (url, error) in
completion(url, error)
})
} else if self.mediaType == .video {
exportVideo(fileName: fileName, utisToConvert: utisToConvert) { (url, error) in
exportVideo(fileName: fileName,
utisToConvert: utisToConvert) { (url, error) in
completion(url, error)
}
} else {
Expand All @@ -455,12 +475,13 @@ extension PHAsset {
- parameter core: Reference to the core to be used for the upload
- parameter rootItem: Directory item where the media file shall be uploaded
- parameter utisToConvert: Array of UTI identifiers describing desired output formats
- parameter preferredResourceTypes: list of resource types which shall be preferrably exported
- parameter preserveOriginalName If true, use original file name from the photo library
- parameter completionHandler: Completion handler called after the media file is imported into the core and placeholder item is created.
- parameter progressHandler: Receives progress of the at the moment running activity
- parameter uploadCompleteHandler: Called when core reports that upload is done
*/
func upload(with core:OCCore?, at rootItem:OCItem, utisToConvert:[String] = [], preserveOriginalName:Bool = true, progressHandler:((_ progress:Progress) -> Void)? = nil, uploadCompleteHandler:(() -> Void)? = nil) -> (OCItem?, Error?)? {
func upload(with core:OCCore?, at rootItem:OCItem, utisToConvert:[String] = [], preferredResourceTypes:[PHAssetResourceType] = [], preserveOriginalName:Bool = true, progressHandler:((_ progress:Progress) -> Void)? = nil, uploadCompleteHandler:(() -> Void)? = nil) -> (OCItem?, Error?)? {

func performUpload(sourceURL:URL, copySource:Bool, cellularSwitchIdentifier:OCCellularSwitchIdentifier?) -> (OCItem?, Error?)? {

Expand Down Expand Up @@ -533,7 +554,7 @@ extension PHAsset {

// Synchronously export asset
let semaphore = DispatchSemaphore(value: 0)
export(fileName: assetName, utisToConvert: utisToConvert) { (url, error) in
export(fileName: assetName, utisToConvert: utisToConvert, preferredResourceTypes: preferredResourceTypes) { (url, error) in
exportedAssetURL = url
outError = error
semaphore.signal()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "raw_badge.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
6 changes: 6 additions & 0 deletions ownCloud/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -814,3 +814,9 @@
"W" = "W";
"N" = "N";
"S" = "S";

/* Pro photo upload settings */
"Extended upload settings" = "Extended upload settings";
"Prefer unedited photos" = "Prefer unedited photos";
"Prefer RAW photos" = "Prefer RAW photos";

1 change: 1 addition & 0 deletions ownCloud/Settings/LogSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class LogSettingsViewController: StaticTableViewController {
logLevelSection = StaticTableViewSection(headerTitle: "Log Level".localized)

let logLevels : [[String:Any]] = [
[ OCLogLevel.verbose.label : OCLogLevel.verbose.rawValue ],
[ OCLogLevel.debug.label : OCLogLevel.debug.rawValue ],
[ OCLogLevel.info.label : OCLogLevel.info.rawValue ],
[ OCLogLevel.warning.label : OCLogLevel.warning.rawValue ],
Expand Down
Loading