-
Notifications
You must be signed in to change notification settings - Fork 1.3k
EXIF removal set to off by default #3043
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
EXIF removal set to off by default #3043
Conversation
* Fix bugs in peer review flow * Fix tests * Bug fixes * Fix remaining issues with peer review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ A review job has been created and sent to the PullRequest network.
@VitalyVPinchuk you can click here to see the review status or cancel the code review job.
Codecov Report
@@ Coverage Diff @@
## master #3043 +/- ##
=========================================
- Coverage 4.41% 4.41% -0.01%
=========================================
Files 259 259
Lines 12309 12310 +1
Branches 1056 1056
=========================================
Hits 544 544
- Misses 11726 11727 +1
Partials 39 39
Continue to review full report at Codecov.
|
Hi @VitalyVPinchuk , I was looking into the code, In FileProcessor#getExifTagsToRedact. As far as I could understand, there is no where we check which tags need to be redacted
This is code which fetches the list of attributes to be redacted, but how does it verify the on/off state ? |
Hi @ashishkumar468 |
@VitalyVPinchuk As far as I understand, the ticked one's should not be redacted, and those which are not ticked, those should be redacted. Would be better if one of @misaochan @neslihanturan @maskaravivek @nicolas-raoul could confirm this ? |
Yes. This is exactly what it does. What seems to be wrong? |
`Set prefManageEXIFTags = defaultKvStore.getJson(Prefs.MANAGED_EXIF_TAGS, setType);``` @VitalyVPinchuk This gives null when all of them are ticked, because of which, these attributes do not get removed from the attributes which need to be redacted, as a result of which, even the ticket attributes get redacted |
Hi @VitalyVPinchuk , I rechecked, the value which is coming from preference is null |
A probable cause is that although these values are checked by default, they have no entries in the preferences and would be added only when we check/uncheck them and that is why null is being returned when we ask for it. |
Yes, you're absolutely right. Now I see. The values are added to preferences only after checking/unchecking them. I didn't know about that. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! What is the best way to set defaults for preferences from xml file? |
* Removed hardcoded strings in DeleteHelper * Revert "Removed hardcoded strings in DeleteHelper" This reverts commit 4bc55fc.
Hi @VitalyVPinchuk , Apologies for the delayed response, you can use something like this See this |
I wonder what I should do to set defaults from xml into |
Hi @VitalyVPinchuk , please do not use shared preferences at all. Instead use defaultKvStore. You can simply search in settings fragment and see it's usages. And then please remove shared preferences added by you. An example: |
Hi @neslihanturan , sure I will remove shared preferences. Just added the code for test reasons. But is there a way to use defaults from XML with defaultKvStore just like |
Hi @VitalyVPinchuk , I think this line "addPreferencesFromResource(R.xml.preferences);" already gets all default preferences values. So multiSelectListPref should have the default values. Can you try seeing the default content of:
|
Thanks! It works. But we also need to use defaults even without opening settings activity (where we load them). What could be done about that? |
@VitalyVPinchuk Do you mean that the values are initialised only when SettingsActivity is opened ? |
I guess so. |
Then can we not initialise them in the App class , CommonsApplication ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VitalyVPinchuk Can you please make the suggested changes. Also, IMO we should simply check if shared pref has the exif values set or not. If its not set at all then we can assume that the user doesn't want us to remove EXIF information.
app/src/main/java/fr/free/nrw/commons/upload/FileProcessor.java
Outdated
Show resolved
Hide resolved
app/src/main/java/fr/free/nrw/commons/upload/FileProcessor.java
Outdated
Show resolved
Hide resolved
…t been initialized
Hi @maskaravivek But still, I think we should read For example, if I change default value for |
Is this PR ready for testing? :) |
Yes, it is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✖️ This code review was cancelled. See Details
Don't worry about the unit tests - this is a bugfix anyway so no need for that. :) Yes, I was planning on testing your PR as all PRs need to be manually tested before we merge them. But I just noticed that you have submitted your PR to master, whereas this bugfix is needed in |
Hello @misaochan |
@misaochan @VitalyVPinchuk I just rebased the PR against |
@maskaravivek Changing the base alone is insufficient, though - as you can see, now there are 72 files changed. ;) The person submitting the PR still needs to rebase on 2.11-release via git. @VitalyVPinchuk You can use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the code changes. Wasn't able to test the changes.
Hello @misaochan @maskaravivek |
Yes, @VitalyVPinchuk . Please do it. As you can see the number of file changes are 72, and relevant to yours would be 3-4 I guess :-) |
…t been initialized
* Removed hardcoded strings in DeleteHelper * Revert "Removed hardcoded strings in DeleteHelper" This reverts commit 4bc55fc.
…s-android-commons into fix_defaults_for_exif
Umm, there are still 66 changes, haha... @VitalyVPinchuk , would it help if you created a new PR from scratch? You can create a local branch based on 2.11-release, copy your changes to that branch, and then submit your PR to 2.11-release, if that would be easier for you than trying to figure out the rebase. Alternatively we can create the PR for you, but then it wouldn't be attributed to you, so we will try to avoid this if possible. |
Ok, I'll make a local branch from 2.11-release and put the changes there. |
Description (required)
Settings -> Privacy -> Manage EXIF TAGS -> all tags checked
Based upon discussion #2863 (comment)
What changes did you make and why?
Set default values to ON for manageExifTags preference.
Tested betaDebug on emulator with API level 28.