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

Rotated+uploaded pic not considered uploaded by custom picker #5384

Open
nicolas-raoul opened this issue Nov 13, 2023 · 9 comments · May be fixed by #5569
Open

Rotated+uploaded pic not considered uploaded by custom picker #5384

nicolas-raoul opened this issue Nov 13, 2023 · 9 comments · May be fixed by #5569

Comments

@nicolas-raoul
Copy link
Member

nicolas-raoul commented Nov 13, 2023

Steps:

  1. Find an encyclopedia-worthy pic which needs to be rotated (ask me if you want some).
  2. Start upload it.
  3. At the caption step, rotate it to correct angle (tap Edit image then Rotate then Save).
  4. After upload, open the folder in the custom picker.
  5. Custom picker shows already uploaded pictures with a Commons overlay icon. Problem: Pic does not have this overlay applied.

Ideally the app would insert the "already uploaded" info into the local database.

@srishti-R
Copy link
Contributor

Tried replicating this by changing screen orientation to landscape from portrait at the caption step, it showed correctly for me then after upload is finished in custom picker. Anything I am missing here?

@nicolas-raoul
Copy link
Member Author

@srishti-R Do you mean it shows with the Commons logo icon at the bottom of the thumbnail? If not sure would you mind posting a screenshot and precise which pic you uploaded with rotation? Thanks! :-)

@srishti-R
Copy link
Contributor

srishti-R commented Nov 23, 2023

@nicolas-raoul Here's the screen capture.
https://github.com/commons-app/apps-android-commons/assets/53987325/614ac2a8-aaaa-4c64-a0f9-1afd04a822b9

oh did this mean rotating the image as in when editing the image and not the screen orientation?

@nicolas-raoul
Copy link
Member Author

nicolas-raoul commented Nov 23, 2023

Sorry yes, you have to tap Edit image then Rotate then Save, I will edit the description to make it unambiguous. Thanks! :-)

@nicolas-raoul nicolas-raoul changed the title Rotated+uploaded pic not considered uploaded by custo picker Rotated+uploaded pic not considered uploaded by custom picker Nov 30, 2023
@srishti-R
Copy link
Contributor

@nicolas-raoul I tried to attempt this by making LLJTran write the rotated bitmap to the source file instead of creating a separate file. Even when it does, the SHA of the image that is fetched from commons server tells the custom selector that the unrotated image is not the one that was uploaded. Is SHA stored on server dependent on bitmap or the file that was uploaded? If its bitmap, cant do much, since the bitmap was changed and not the file.

@nicolas-raoul
Copy link
Member Author

We have a local table containing SHA1 of uploaded files, which we use as a cache.
For this issue, it would be enough to just add the SHA1 of both unmodified and modified files to that local cache table.

This cache unfortunately disappears when reinstalling the app, but the solution proposed here is a lower-hanging fruit than the solution proposed at #5295, and probably good enough for most users.

@srishti-R
Copy link
Contributor

Could you point me to the file where the local cache of SHA1s is present? All I could find out was the code that is checking if the image exists on server using APIs.

@nicolas-raoul
Copy link
Member Author

nicolas-raoul commented Dec 14, 2023

You mean we don't call UploadedDao.insertUploaded to modify uploaded_table after uploading?

@mshdabiola
Copy link
Contributor

can you assign this issue to me, i think it is related to #5363 issue i just fixed

@mshdabiola mshdabiola linked a pull request Feb 20, 2024 that will close this issue
mshdabiola added a commit to mshdabiola/apps-android-commons that referenced this issue Feb 21, 2024
[some android sdk that is greater than 28 unable to add image to media store database]

[fixed: commons-app#5384]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants