Skip to content

Commit

Permalink
Pro Photo Upload Settings (#759)
Browse files Browse the repository at this point in the history
* Started implementing EXIF metadata viewer

* Conversion of APEX units. EXIF AUX section

* Added histogram created with CoreImage

* Using more appropriate image creation method

* Added GPS location parsing / presentation

* Made image details formatting more compact

* Added header with image thumbnail, file size info

And.. IPTC meta-data parsing

* Added TIFF meta-data

* Added TIFF:PhotometricInterpretation mapping

* Small fixes in the EXIF meta data view

- Progress indicator while data is being generated
- Fixed parsing of ISO speed rating (film sensitivity)
- Not displaying meta-data where value is empty

* Moved GPS data to the top, improved exposure bias formatting

* few text formatting fixes

* Layout changes to make metadata view look nicer on iPad

* Pro photo features configured as IAP

* Localization changes

* Fixed wrong text formatting

* Started implemented pro photo upload settings

* Added extended photo upload settings

- Prefer uploading originals (non-edited)
- Prefer uploading RAW images

* First functioning implementation

* Fixed issue with image preview rotation

* Fixed rotation issue in image preview

* Fixed incorrect image dimensions in case of RAW photo

* Added a RAW photo badge in photo picker

* Added ‘Pro Photo’ IAP as a single purchasable product

* Changed wording and added localized strings

* Check user eligibility for using pro photo upload features

- Allow all enterprise users to use RAW / original photo upload
- Allow users who has purchased an IAP

* Fixed code review findings

* Fixed review findings

- Color space was wrongly named as exposure bias (copy-paste error)
- Reduced precision of displayed altitude to two decimal digits

* Changed app store IAP identifier for Pro Photo package

AppStore Connect doesnt support hyphens

* Update oC SDK

* Fixed issues with previously merged code not buildable

* Updated oc SDK

* Merged latest changes and made branch buildable again

* - revert reverted changes in ownCloud File Provider/OCItem+FileProviderItem.m

* - revert logging-related reverts performed by 72c2d80

* - revert bugfix removal originating from 905f485

* Avoid recomputing badge images used in table view cells

Plus change access level of some properties from fileprivate to private

* Corrected review findings

- Avoiding blocking main thread
- Observing product license asynchronously
- Reacting to enterprise account addition / removal by observing corresponding notification

* Fixed latest review findings

* Made code more reliable in terms of reacting to account changes in a multi window environment

* Changed the logic how photo resource is chosen for export

* More robust detection of RAW assets

Soe apps don’t seem to follow guidelines for storing RAW photos suggested by Apple. So instead of using alternatePhoto, they store RAW as main resource

* Don’t show prefer RAW option if there is no camera on board which would support shooting RAW

* Fixed compilation issues with Xcode 11.7

Co-authored-by: Michael Neuwert <mn@neuwert-media.com>
Co-authored-by: Matthias Hühne <github@hosy.de>
Co-authored-by: Felix Schwarz <fs-git@iospirit.com>
Co-authored-by: Michael Neuwert <michael.neuwert@gmail.com>
  • Loading branch information
5 people authored Sep 24, 2020
1 parent 1895263 commit 037c787
Show file tree
Hide file tree
Showing 25 changed files with 348 additions and 85 deletions.
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 9075b8f92281024401a0039c3477c9a16650b092

COCOAPODS: 1.8.4
COCOAPODS: 1.9.3
2 changes: 1 addition & 1 deletion ios-sdk
Submodule ios-sdk updated 1 files
+1 −1 doc/CONFIGURATION.md
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
10 changes: 5 additions & 5 deletions ownCloud Intents/CreateFolderIntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ownCloudAppShared
@available(iOS 13.0, *)
public class CreateFolderIntentHandler: NSObject, CreateFolderIntentHandling {

public func handle(intent: CreateFolderIntent, completion: @escaping (CreateFolderIntentResponse) -> Void) {
public func handle(intent: CreateFolderIntent, completion: @escaping (CreateFolderIntentResponse) -> Void) {

guard IntentSettings.shared.isEnabled else {
completion(CreateFolderIntentResponse(code: .disabled, userActivity: nil))
Expand Down Expand Up @@ -83,27 +83,27 @@ public class CreateFolderIntentHandler: NSObject, CreateFolderIntentHandling {
}
}

public func resolveName(for intent: CreateFolderIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
public func resolveName(for intent: CreateFolderIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
if let name = intent.name {
completion(INStringResolutionResult.success(with: name))
} else {
completion(INStringResolutionResult.needsValue())
}
}

public func resolveAccount(for intent: CreateFolderIntent, with completion: @escaping (AccountResolutionResult) -> Void) {
public func resolveAccount(for intent: CreateFolderIntent, with completion: @escaping (AccountResolutionResult) -> Void) {
if let account = intent.account {
completion(AccountResolutionResult.success(with: account))
} else {
completion(AccountResolutionResult.needsValue())
}
}

public func provideAccountOptions(for intent: CreateFolderIntent, with completion: @escaping ([Account]?, Error?) -> Void) {
public func provideAccountOptions(for intent: CreateFolderIntent, with completion: @escaping ([Account]?, Error?) -> Void) {
completion(OCBookmarkManager.shared.accountList, nil)
}

public func resolvePath(for intent: CreateFolderIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
public func resolvePath(for intent: CreateFolderIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
if let path = intent.path {
completion(INStringResolutionResult.success(with: path))
} else {
Expand Down
8 changes: 4 additions & 4 deletions ownCloud Intents/DeletePathItemIntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ownCloudAppShared
@available(iOS 13.0, *)
public class DeletePathItemIntentHandler: NSObject, DeletePathItemIntentHandling {

public func handle(intent: DeletePathItemIntent, completion: @escaping (DeletePathItemIntentResponse) -> Void) {
public func handle(intent: DeletePathItemIntent, completion: @escaping (DeletePathItemIntentResponse) -> Void) {

guard IntentSettings.shared.isEnabled else {
completion(DeletePathItemIntentResponse(code: .disabled, userActivity: nil))
Expand Down Expand Up @@ -72,19 +72,19 @@ public class DeletePathItemIntentHandler: NSObject, DeletePathItemIntentHandling
}
}

public func resolveAccount(for intent: DeletePathItemIntent, with completion: @escaping (AccountResolutionResult) -> Void) {
public func resolveAccount(for intent: DeletePathItemIntent, with completion: @escaping (AccountResolutionResult) -> Void) {
if let account = intent.account {
completion(AccountResolutionResult.success(with: account))
} else {
completion(AccountResolutionResult.needsValue())
}
}

public func provideAccountOptions(for intent: DeletePathItemIntent, with completion: @escaping ([Account]?, Error?) -> Void) {
public func provideAccountOptions(for intent: DeletePathItemIntent, with completion: @escaping ([Account]?, Error?) -> Void) {
completion(OCBookmarkManager.shared.accountList, nil)
}

public func resolvePath(for intent: DeletePathItemIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
public func resolvePath(for intent: DeletePathItemIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
if let path = intent.path {
completion(INStringResolutionResult.success(with: path))
} else {
Expand Down
6 changes: 3 additions & 3 deletions ownCloud Intents/GetAccountIntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ownCloudAppShared
@available(iOS 13.0, *)
public class GetAccountIntentHandler: NSObject, GetAccountIntentHandling {

public func handle(intent: GetAccountIntent, completion: @escaping (GetAccountIntentResponse) -> Void) {
public func handle(intent: GetAccountIntent, completion: @escaping (GetAccountIntentResponse) -> Void) {

guard IntentSettings.shared.isEnabled else {
completion(GetAccountIntentResponse(code: .disabled, userActivity: nil))
Expand Down Expand Up @@ -54,15 +54,15 @@ public class GetAccountIntentHandler: NSObject, GetAccountIntentHandling {
completion(GetAccountIntentResponse.success(account: account))
}

public func resolveAccountUUID(for intent: GetAccountIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
public func resolveAccountUUID(for intent: GetAccountIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
if let account = intent.accountUUID {
completion(INStringResolutionResult.success(with: account))
} else {
completion(INStringResolutionResult.needsValue())
}
}

public func confirm(intent: GetAccountIntent, completion: @escaping (GetAccountIntentResponse) -> Void) {
private func confirm(intent: GetAccountIntent, completion: @escaping (GetAccountIntentResponse) -> Void) {
completion(GetAccountIntentResponse(code: .ready, userActivity: nil))
}
}
Expand Down
4 changes: 2 additions & 2 deletions ownCloud Intents/GetAccountsIntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ownCloudAppShared
@available(iOS 13.0, *)
public class GetAccountsIntentHandler: NSObject, GetAccountsIntentHandling {

public func handle(intent: GetAccountsIntent, completion: @escaping (GetAccountsIntentResponse) -> Void) {
public func handle(intent: GetAccountsIntent, completion: @escaping (GetAccountsIntentResponse) -> Void) {

guard IntentSettings.shared.isEnabled else {
completion(GetAccountsIntentResponse(code: .disabled, userActivity: nil))
Expand All @@ -42,7 +42,7 @@ public class GetAccountsIntentHandler: NSObject, GetAccountsIntentHandling {
completion(GetAccountsIntentResponse.success(accountList: OCBookmarkManager.shared.accountList))
}

public func confirm(intent: GetAccountsIntent, completion: @escaping (GetAccountsIntentResponse) -> Void) {
private func confirm(intent: GetAccountsIntent, completion: @escaping (GetAccountsIntentResponse) -> Void) {
completion(GetAccountsIntentResponse(code: .ready, userActivity: nil))
}
}
Expand Down
4 changes: 2 additions & 2 deletions ownCloud Intents/GetDirectoryListingIntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class GetDirectoryListingIntentHandler: NSObject, GetDirectoryListingInte

var completion : GetDirectoryListingCompletionHandler?

public func resolvePath(for intent: GetDirectoryListingIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
public func resolvePath(for intent: GetDirectoryListingIntent, with completion: @escaping (INStringResolutionResult) -> Void) {

if let path = intent.path {
completion(INStringResolutionResult.success(with: path))
Expand Down Expand Up @@ -124,7 +124,7 @@ public class GetDirectoryListingIntentHandler: NSObject, GetDirectoryListingInte
self.completion?(GetDirectoryListingIntentResponse(code: .failure, userActivity: nil))
}

public func confirm(intent: GetDirectoryListingIntent, completion: @escaping (GetDirectoryListingIntentResponse) -> Void) {
private func confirm(intent: GetDirectoryListingIntent, completion: @escaping (GetDirectoryListingIntentResponse) -> Void) {
completion(GetDirectoryListingIntentResponse(code: .ready, userActivity: nil))
}
}
Expand Down
8 changes: 4 additions & 4 deletions ownCloud Intents/GetFileIntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typealias GetFileCompletionHandler = (GetFileIntentResponse) -> Void
@available(iOS 13.0, *)
public class GetFileIntentHandler: NSObject, GetFileIntentHandling {

public func handle(intent: GetFileIntent, completion: @escaping (GetFileIntentResponse) -> Void) {
public func handle(intent: GetFileIntent, completion: @escaping (GetFileIntentResponse) -> Void) {

guard IntentSettings.shared.isEnabled else {
completion(GetFileIntentResponse(code: .disabled, userActivity: nil))
Expand Down Expand Up @@ -77,7 +77,7 @@ public class GetFileIntentHandler: NSObject, GetFileIntentHandling {
}
}

public func resolvePath(for intent: GetFileIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
public func resolvePath(for intent: GetFileIntent, with completion: @escaping (INStringResolutionResult) -> Void) {

if let path = intent.path {
completion(INStringResolutionResult.success(with: path))
Expand All @@ -86,11 +86,11 @@ public class GetFileIntentHandler: NSObject, GetFileIntentHandling {
}
}

public func provideAccountOptions(for intent: GetFileIntent, with completion: @escaping ([Account]?, Error?) -> Void) {
public func provideAccountOptions(for intent: GetFileIntent, with completion: @escaping ([Account]?, Error?) -> Void) {
completion(OCBookmarkManager.shared.accountList, nil)
}

public func resolveAccount(for intent: GetFileIntent, with completion: @escaping (AccountResolutionResult) -> Void) {
public func resolveAccount(for intent: GetFileIntent, with completion: @escaping (AccountResolutionResult) -> Void) {
if let account = intent.account {
completion(AccountResolutionResult.success(with: account))
} else {
Expand Down
4 changes: 2 additions & 2 deletions ownCloud Intents/OCBookmarkManager+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import ownCloudSDK
@available(iOS 13.0, *)
extension OCBookmarkManager {

public var accountList : [Account] {
var accountList : [Account] {
var accountList : [Account] = []
accountList = OCBookmarkManager.shared.bookmarks.map { (bookmark) -> Account in
let account = Account(identifier: bookmark.uuid.uuidString, display: bookmark.shortName)
Expand All @@ -40,7 +40,7 @@ extension OCBookmarkManager {
return OCBookmarkManager.shared.bookmarks.filter({ $0.uuid.uuidString == uuidString}).first
}

public func accountBookmark(for uuidString: String) -> (OCBookmark, Account)? {
func accountBookmark(for uuidString: String) -> (OCBookmark, Account)? {
if let bookmark = bookmark(for: uuidString) {
let account = Account(identifier: bookmark.uuid.uuidString, display: bookmark.shortName)
account.name = bookmark.shortName
Expand Down
8 changes: 4 additions & 4 deletions ownCloud Intents/PathExistsIntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ownCloudAppShared
@available(iOS 13.0, *)
public class PathExistsIntentHandler: NSObject, PathExistsIntentHandling {

public func handle(intent: PathExistsIntent, completion: @escaping (PathExistsIntentResponse) -> Void) {
public func handle(intent: PathExistsIntent, completion: @escaping (PathExistsIntentResponse) -> Void) {

guard IntentSettings.shared.isEnabled else {
completion(PathExistsIntentResponse(code: .disabled, userActivity: nil))
Expand Down Expand Up @@ -62,19 +62,19 @@ public class PathExistsIntentHandler: NSObject, PathExistsIntentHandling {
}
}

public func resolveAccount(for intent: PathExistsIntent, with completion: @escaping (AccountResolutionResult) -> Void) {
public func resolveAccount(for intent: PathExistsIntent, with completion: @escaping (AccountResolutionResult) -> Void) {
if let account = intent.account {
completion(AccountResolutionResult.success(with: account))
} else {
completion(AccountResolutionResult.needsValue())
}
}

public func provideAccountOptions(for intent: PathExistsIntent, with completion: @escaping ([Account]?, Error?) -> Void) {
public func provideAccountOptions(for intent: PathExistsIntent, with completion: @escaping ([Account]?, Error?) -> Void) {
completion(OCBookmarkManager.shared.accountList, nil)
}

public func resolvePath(for intent: PathExistsIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
public func resolvePath(for intent: PathExistsIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
if let path = intent.path {
completion(INStringResolutionResult.success(with: path))
} else {
Expand Down
16 changes: 8 additions & 8 deletions ownCloud Intents/SaveFileIntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ownCloudAppShared
@available(iOS 13.0, *)
public class SaveFileIntentHandler: NSObject, SaveFileIntentHandling {

public func handle(intent: SaveFileIntent, completion: @escaping (SaveFileIntentResponse) -> Void) {
public func handle(intent: SaveFileIntent, completion: @escaping (SaveFileIntentResponse) -> Void) {

guard IntentSettings.shared.isEnabled else {
completion(SaveFileIntentResponse(code: .disabled, userActivity: nil))
Expand Down Expand Up @@ -115,43 +115,43 @@ public class SaveFileIntentHandler: NSObject, SaveFileIntentHandling {
}
}

public func provideAccountOptions(for intent: SaveFileIntent, with completion: @escaping ([Account]?, Error?) -> Void) {
public func provideAccountOptions(for intent: SaveFileIntent, with completion: @escaping ([Account]?, Error?) -> Void) {
completion(OCBookmarkManager.shared.accountList, nil)
}

public func resolveAccount(for intent: SaveFileIntent, with completion: @escaping (AccountResolutionResult) -> Void) {
public func resolveAccount(for intent: SaveFileIntent, with completion: @escaping (AccountResolutionResult) -> Void) {
if let account = intent.account {
completion(AccountResolutionResult.success(with: account))
} else {
completion(AccountResolutionResult.needsValue())
}
}

public func resolvePath(for intent: SaveFileIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
public func resolvePath(for intent: SaveFileIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
if let path = intent.path {
completion(INStringResolutionResult.success(with: path))
} else {
completion(INStringResolutionResult.needsValue())
}
}

public func resolveFile(for intent: SaveFileIntent, with completion: @escaping (INFileResolutionResult) -> Void) {
public func resolveFile(for intent: SaveFileIntent, with completion: @escaping (INFileResolutionResult) -> Void) {
if let file = intent.file {
completion(INFileResolutionResult.success(with: file))
} else {
completion(INFileResolutionResult.needsValue())
}
}

public func resolveFilename(for intent: SaveFileIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
public func resolveFilename(for intent: SaveFileIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
completion(INStringResolutionResult.success(with: intent.filename ?? ""))
}

public func resolveFileextension(for intent: SaveFileIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
public func resolveFileextension(for intent: SaveFileIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
completion(INStringResolutionResult.success(with: intent.fileextension ?? ""))
}

public func resolveShouldOverwrite(for intent: SaveFileIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) {
public func resolveShouldOverwrite(for intent: SaveFileIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) {
var shouldOverwrite = false
if let overwrite = intent.shouldOverwrite?.boolValue {
shouldOverwrite = overwrite
Expand Down
Loading

0 comments on commit 037c787

Please sign in to comment.