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

Google Camera effects broke camera upload feature #2407

Open
schwedenmut opened this issue Dec 26, 2018 · 5 comments
Open

Google Camera effects broke camera upload feature #2407

schwedenmut opened this issue Dec 26, 2018 · 5 comments

Comments

@schwedenmut
Copy link

Actual behaviour

While using the default Google Camera application on my Pixel 2, all normal taken pictures are considered by the Camera Uploads feature. But by using effekts like Portrait, Panorama, Burst mode, the images will not be synchronized to OwnCloud.

I checked both on 415f88f, current ownCloud 2.9.3 and Sciebo based on 2.8.0

Expected behaviour

Pictures taken by the default camera applikation should be synched, no matter if taken as Portrait or Panorama.

Steps to reproduce

  1. Use Google Camera application
  2. Take a picture in Portrait, Panorama, Burst mode
  3. wait synching time (or compile for debug purposes a lower sync time) for nothing to be uploaded / check the log for ignoring messages

Can this problem be reproduced with the official owncloud server?
(url: https://demo.owncloud.org, user: test, password: test)
I don't think, this is a server issue, more likely a client feature problem.

Environment data

Android version: 9 5.12.2018

Device model: walleye Pixel 2

Stock or customized system: both default ownCloud and Sciebo system

ownCloud app version: 2.9.3 / 2.8.0 / 415f88f

ownCloud server version: can't check and doesn't matter

Logs

Can't provide any, sorry.

Places to fix

in CameraUploadsSyncJobService.java#L124, all the files and folders correctly are gathered in an Array, sorted afterwards and then with the function handleFile() checked. The problem is, that the Google Camera application persists pictures taken in Portrait, Panorama etc. mode will be persisted into a folder with the familiar timestamp as name. Inside this folder there are at least one picturefile inside it. For example folders of portrait pictures usually contain a normal picture named "00000PORTRAIT_00000_BURST20180218135144728.jpg" and one with blurred background "00100dPORTRAIT_00100_BURST20180218135144728_COVER.jpg". Those pictures will be ignored, because the folder checked in handleFile() CameraUploadsSyncJobService.java#L158-L171 is neither a picture nor a video but application/octed-stream as mimeType.

Debug Log localFiles[] content mimeType
unbenannt-fs8 unbenannt2-fs8 unbenannt3-fs8
@schwedenmut
Copy link
Author

schwedenmut commented Dec 26, 2018

btw. I went ahead to check for a quick poc - after changing CameraUploadsSyncJobService.java#L130-L132 from

for (File localFile : localFiles) {
    handleFile(localFile);
}

to

for (File localFile : localFiles) {
    if (!localFile.isDirectory()) {
        handleFile(localFile);
    } else {
        File subfolderFiles[];
        subfolderFiles = localFile.listFiles();
        subfolderFiles = orderFilesByCreationTimestamp(subfolderFiles);
        for (File sufolderFile : subfolderFiles) {
            handleFile(sufolderFile);
        }
    }
}

the pictures from different modes of Google Camera will be detected / not uploaded due to the fact that localPath is reassembled instead of File.getPath() in CameraUploadsSyncJobService.java#L178.
This definitely is only a quick and ugly way to fix default camera.

@hannesa2
Copy link
Contributor

Taste to a relation of
#2249
#2394 (not really solved)

@schwedenmut
Copy link
Author

It really is a pitty that it seems like nobody of the OC team cares. But hey, then I will go on patching this locally to make this work for me....

@davigonz
Copy link
Contributor

Hi @schwedenmut , my apologies for the late response. We are very focused on some architectural changes in the current app.

I see you have already discovered the reason of your issue and even written some pieces of code. I highly encourage you to send us your solution via a pull request, have look at https://github.com/owncloud/android#join-development, it might be useful. Anyway, if you have any other question, do not hesitate to ping me.

As soon as you send us your solution, we will review it and we could even include it in our app.

Thanks!

@davigonz davigonz changed the title Google Camera modes broke camera upload feature Google Camera effects broke camera upload feature Sep 24, 2019
@schwedenmut
Copy link
Author

I will improve and tidy up my local changes and will create a PR shortly. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants