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 modes broke camera upload feature #2407

Open
schwedenmut opened this Issue Dec 26, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@schwedenmut
Copy link

schwedenmut commented Dec 26, 2018

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

This comment has been minimized.

Copy link

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.

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