apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Save "raw" picture in history

Open nicolas-raoul opened this issue 4 years ago • 45 comments

Problem: Smartphones increasingly use post-processing and AI to make picture more vivid/interesting for instance by exaggerating colours or blurring the background. Unfortunately that often makes the pictures less representative of reality. The original is lost.

Idea: Also store a "rawer" version of the picture, if the camera app lets us have it. That one could be saved first, and then the post-processed picture could be saved as a new version of it. All versions stay visible in the file history, making it easy for user to decide which version they want to use:

Screen Shot 2021-11-08 at 23 35 27

Note: The format and filenames of the "raw" versions (when they are saved) are very model-dependent and settings-dependent, but hopefully we can implement this for one model/setting as a proof of concept.

nicolas-raoul avatar Nov 08 '21 14:11 nicolas-raoul

Can I work on this issue?

deek121477 avatar Nov 13 '21 16:11 deek121477

@deek121477 Yes thanks! What phone ad camera app are you using? The first step would be to figure out how to get the "raw" picture, please post your findings here :-)

nicolas-raoul avatar Nov 13 '21 23:11 nicolas-raoul

Thank you for assigning me this issue @nicolas-raoul The phone that I would be using is Android and Adobe Photoshop Camera And I more thing as I am beginner to this project Can this issue be labeled as a good first issue or not?

deek121477 avatar Nov 14 '21 03:11 deek121477

It is a good first issue in the sense that it is limited to a rather specific area of the app. It is more difficult than the average "good first issue", though, but I am sure you can do it :-)

On my Pixel 4 phone the default camera has a setting called RAW+JPEG control which saves a .dng file in the Raw folder. My Galaxy phone also has an option to save raw images as a .dng.

Unfortunately I just discovered that DNG file upload is not implemented yet: https://phabricator.wikimedia.org/T21153 If we have a good proof-of-concept I believe we could raise the priority of that Phabricator ticket.

So I suggest starting with "HDR originals" rather than RAW, since they use JPG rather than DNG.

  1. Install the OpenCamera app and open it.
  2. Tap the 3 dots, tap HDR.
  3. Settings>Photo settings>Save all images for HDR mode.
  4. Take a picture (it takes time as the app actually takes 3 pictures.
  5. Go to Gallery, find the OpenCamera folder. It should have 4 pictures: Low brightness, normal brightness, high brightness, HDR result.

So for now the implementation would be:

  • When uploading a picture, the Commons app first checks whether it is in a folder called "OpenCamera" and whether the 3 HDR pictures are present.
  • If yes, upload all of the 4 pictures one after the other using the Commons "file history" feature shown in the screenshot above. The HDR result should be uploaded last. (The advantage is that in the future whenever more powerful HDR algorithms get developed, Commons people can regenerate the HDR images. Also, for pictures with a historical value, specialists will be able to see all details that are not visible in the result HDR.)

nicolas-raoul avatar Nov 15 '21 07:11 nicolas-raoul

Thank you so much for giving the guidance for approaching the issue. I am done with OpenCamera Part and I have got 4 images too.

deek121477 avatar Nov 15 '21 12:11 deek121477

While uploading images on the commons app I have uploaded only 1 image as there was no option for 4 images to be uploaded. Here I am attaching the link to the image that I have uploaded:

https://commons.m.wikimedia.org/wiki/File:Air_is_wild_with_the_leaves.jpg?markasread=44574435&markasreadwiki=commonswiki

deek121477 avatar Nov 19 '21 15:11 deek121477

@deek121477 At https://commons.wikimedia.org/wiki/File:Air_is_wild_with_the_leaves.jpg you can see a link called Upload a new version of this file. You will have to discover what API calls the form behind that link use. :-)

nicolas-raoul avatar Nov 20 '21 08:11 nicolas-raoul

@deek121477 At https://commons.wikimedia.org/wiki/File:Air_is_wild_with_the_leaves.jpg you can see a link called Upload a new version of this file. You will have to discover what API calls the form behind that link use. :-)

Okay. I will try.

deek121477 avatar Nov 22 '21 03:11 deek121477

While cloning [email protected]:deek121477/apps-android-commons.git

I am getting a message of: [ permission denied(public key) Please make sure you have the correct access rights and the repository exists.] So can I use the git clone command of https://github.com/deek121477/apps-android-commons.git as in the android studio, all files are opening and working properly?

Also, is HAXM needed?

deek121477 avatar Nov 29 '21 06:11 deek121477

Have you tried all troubleshooting steps listed at https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey ?

nicolas-raoul avatar Nov 29 '21 06:11 nicolas-raoul

Have you tried all troubleshooting steps listed at https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey ?

Not yet. I will try

deek121477 avatar Nov 29 '21 07:11 deek121477

Have you tried all troubleshooting steps listed at https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey ?

Not yet. I will try

Can I use HTTPS instead of SSH?

deek121477 avatar Nov 29 '21 07:11 deek121477

I think HTTPS would not allow you to make changes (I could be wrong).

You can start with HTTPS, though. Just make sure to make backups to not lose your changes.

nicolas-raoul avatar Nov 29 '21 07:11 nicolas-raoul

I think HTTPS would not allow you to make changes (I could be wrong).

You can start with HTTPS, though. Just make sure to make backups to not lose your changes.

Okay.I will continue with HTTPS, and make sure about my backups too. I have gone through this article to understand difference between HTTPS and SSH. https://ourtechroom.com/tech/https-vs-ssh-in-git/

deek121477 avatar Nov 29 '21 09:11 deek121477

Actually, I tried making changes in the code But it was a bit confusing to find out code where photos get uploaded in history

deek121477 avatar Dec 22 '21 11:12 deek121477

Can you please help me? Understanding the code base is taking much time.

deek121477 avatar Dec 27 '21 04:12 deek121477

Hi @deek121477, Have you found the chain of method calls that performs the actual file upload? Would you mind posting the list of methods here?

nicolas-raoul avatar Dec 27 '21 05:12 nicolas-raoul

No.I haven't found the chain of method calls

deek121477 avatar Dec 27 '21 06:12 deek121477

@deek121477 I would suggest running the app in debug mode from your IDE (such as Android Studio), setting breakpoints, and actually uploading a picture using the app.

nicolas-raoul avatar Dec 27 '21 09:12 nicolas-raoul

@nicolas-raoul I tried running in debug mode. But it runs very slow on my laptop(4GB RAM). Also setting breakpoints was a bit confusing. Is there any resource where I can learn more about setting breakpoints?

deek121477 avatar Jan 10 '22 15:01 deek121477

@deek121477 In case you're still looking for information about breakpoints, you could take a look at this resource: Breakpoints - Debug your app  |  Android Developers. You could also read the full guide here: Debug your app  |  Android Developers

sivaraam avatar Jan 24 '22 17:01 sivaraam

Hi @nicolas-raoul Can I take this up?

bhavanagarlapati avatar Dec 06 '22 08:12 bhavanagarlapati

@deek121477 Any progress on this? :-)

@bhavanagarlapati Please take one issue at a time. Do not hesitate to come back to this one after sending a pull request for your currently assigned one. :-)

nicolas-raoul avatar Dec 07 '22 08:12 nicolas-raoul

@deek121477 Any progress on this? :-)

@bhavanagarlapati Please take one issue at a time. Do not hesitate to come back to this one after sending a pull request for your currently assigned one. :-)

No

deek121477 avatar Dec 07 '22 09:12 deek121477

@deek121477 Do you have plans to pursue this further? It's totally fine either way 🙂

sivaraam avatar Jan 26 '23 17:01 sivaraam

is someone working on this? I wanna try this

XxBrezxX avatar Jul 04 '23 21:07 XxBrezxX

@XxBrezxX Please focus on one issue at a time :-) Thanks for your enthusiasm!

nicolas-raoul avatar Jul 05 '23 03:07 nicolas-raoul

Has this issue been completely resolved? Can I try this question? I'm using an Apple phone and I don't know if I can try this problem.

ZIYANGSONG2003 avatar Oct 17 '23 03:10 ZIYANGSONG2003

Not sure if i can try on this issue.

antungchen avatar Oct 21 '23 00:10 antungchen

@ZIYANGSONG2003 I don't think an Apple phone would help here sorry! :'-(

@antungchen It is yours!

nicolas-raoul avatar Oct 21 '23 13:10 nicolas-raoul