Add in-app camera with direct upload to Nextcloud#4058
Add in-app camera with direct upload to Nextcloud#4058Rasmussw wants to merge 2 commits intonextcloud:masterfrom
Conversation
|
@Rasmussw can you make a rebase ? thanks |
7ded060 to
5b66fa5
Compare
|
Hi @marinofaggiana I've rebased onto the latest master. |
There are some compilation errors (due to the master change). Please rebase and try compiling it. Thanks. |
5b66fa5 to
6efca7e
Compare
6efca7e to
d375a16
Compare
Introduces a custom AVFoundation camera that captures photos and videos and uploads them directly to Nextcloud without saving to the device camera roll by default. - Custom camera UI: shutter, flash, flip, mode selector (photo/video) - Pinch-to-zoom from 0.5x (ultra-wide) to 10x with live zoom label - Virtual multi-camera support (triple/dual-wide) for sub-1x zoom - Recording timer with red dot, screen stays on during video recording - App backgrounding gracefully stops recording in progress - Review screen after capture: retake or use, inline video playback - "Save to camera roll" opt-in toggle per session (off by default) - Global default for toggle in Settings -> Advanced - Filenames follow Nextcloud conventions via createFileName(), including "Maintain original filename" mode (IMG_XXXX.JPG) - Videos saved as .mov (QuickTime) matching Apple native camera format - Restored live photo upload logic: livePhotoFile and nativeFormat were inadvertently removed in a previous refactor - Fix: PHAuthorizationStatus.limited now correctly treated as authorized - Fix: NCViewerQuickLookView crash when asset is nil after model change Signed-off-by: Rasmus Wøldike <rswoldike@gmail.com>
d375a16 to
8330e77
Compare
Signed-off-by: Rasmus Wøldike <rswoldike@gmail.com>
8330e77 to
9b90f77
Compare
|
|
||
| var saveCameraMediaToCameraRoll: Bool { | ||
| get { | ||
| return getBoolPreference(key: "saveCameraMediaToCameraRoll", defaultValue: false) |
There was a problem hiding this comment.
default, for compatibility with previous version, must be set to true
| "_e2e_remove_folder_encrypted_" = "Decrypt"; | ||
| "_e2e_file_encrypted_" = "File encrypted"; | ||
| "_e2e_goto_settings_for_enable_" = "This is an encrypted directory, go to \"Settings\" and enable end-to-end encryption"; | ||
| "_e2e_error_" = "An internal end-to-end encryption error occurred."; |
| let isVideo: Bool | ||
| } | ||
| } | ||
|
|
|
Note: dear @Rasmussw It seems like the change is significant. The library is very outdated and one might consider replacing it (also). |
|
Hi Marino Thanks for the review.
First of all, we need to understand if there is an actual interest in this
feature from Nextcloud, if we take care of the issues you mentioned? If
there is, is it then a requirement that we fork TLPhotoPicker or is fine
the way we have implemented the feature as it is now? We believed that
there would be more work and maintenance for you at Nextcloud if we
implemented the feature by making the fork, thus we went with a solution
matching the current state of the Nextcloud iOS app.
We will off course look into the problems regarding the lint and ipad
issues.
Best regards, Rasmus
|
|
Hi @Rasmussw , Thanks for the clarification. Yes, I am interested in this feature, and I think the proposed change is a very good improvement for the app. From my point of view, keeping most of the implementation on the Nextcloud side is fine and probably easier to maintain. My main concern was the automatic save to the user’s Photo Library when taking a photo or video from TLPhotoPicker. Since we have now identified the exact point where this happens, I think the cleanest solution would probably be a small and focused change in TLPhotoPicker: add a configuration flag to decide whether captured photos/videos should be saved to the Photo Library or written to a temporary/custom location instead. On the Nextcloud side, we would then only need to retrieve those captured images/videos from that location and continue with the existing upload flow. However, I also noticed that the camera capture UI/flow seems to have changed, especially on iPad. I would like to better understand that part before deciding the final direction, because this is not only about where the captured file is saved, but also about how the capture view is presented and handled across devices. So, I would not require a full fork if this can be handled with a small, focused change. Ideally, this could be proposed upstream. If that is not possible, then a minimal fork limited to this behavior could also be acceptable. We will of course also need to address the lint and iPad issues before merging. |


This PR adds a custom in-app camera to the iOS client that captures photos and videos and uploads them directly to Nextcloud, bypassing the device camera roll by default. Users can optionally enable saving to the camera roll via a per-session toggle, with a global default available in Settings -> Advanced.
In the current flow, media is always saved to the system photo library before being uploaded to Nextcloud. This creates potentially unwanted local copies, introduces privacy concerns, and adds manual cleanup for users. This change ensures media can be captured and stored directly in Nextcloud without ever touching the camera roll. This is especially important in regulated environments with BYOD-policies, i.e. environments where media content captured can identify a person, thus potentially violating GDPR.
The custom camera uses AVFoundation to capture media directly to a temporary directory. Files are reviewed before upload and then passed into Nextcloud's existing upload pipeline. Saving to the camera roll is fully optional and only occurs if explicitly enabled by the user. Existing picker and upload flows remain unchanged.
Additional notes
Default behaviour does not affect existing users
Upload reliability uses existing background upload infrastructure
Camera roll is never accessed unless explicitly enabled