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

Fix custom picker not consider rotated image #5569

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mshdabiola
Copy link
Contributor

@mshdabiola mshdabiola commented Feb 20, 2024

Description (required)

Fixes #5384

change where rotated image is saved and add image to media store

Tests performed (required)

Tested BetaDebug on Tecno Spark Air with API level 38.

[The image path of rotated image is not save like nornal image.
so imageview cannot load rotated image

check whether the image path is file uri then add imagerequest to load the image]

[fixed: thumbnail not visible when upload rotated image]
…custom picker

[Rotated image is now saved in directory where capture image is saved
and image is inserted to media store]

[fixed: Rotated uploaded pic not considered uploaded by custom picker]
@nicolas-raoul
Copy link
Member

Testing this pull request now, I am geting tthis error:

screen-20240220-232741.mp4

Any idea why? 🙂

@mshdabiola
Copy link
Contributor Author

mshdabiola commented Feb 21, 2024

I will test again and get back to u

[some android sdk that is greater than 28 unable to add image to media store database]

[fixed: commons-app#5384]
@mshdabiola
Copy link
Contributor Author

mshdabiola commented Feb 21, 2024

I have fixed the bug

the phone am using is android sdk 28, that is why i use emulator to test

bugs.mp4

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried rotating and uploading a picture:

Screenshot_20240221-215819.png

Uploaded:

Screenshot_20240221-220119.png

Bug still present: The thumbnail does not show a Commons icon overlay (such an overlay indicates that the picture has been uploaded already):

Screenshot_20240221-215947.png

@@ -3,11 +3,17 @@ package fr.free.nrw.commons.edit
import android.animation.Animator
import android.animation.Animator.AnimatorListener
import android.animation.ValueAnimator
import android.content.ContentResolver
import android.content.ContentValues
import android.content.Intent
import android.graphics.BitmapFactory
import android.graphics.Matrix
import android.media.ExifInterface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, few nitpicks rest good.

- import android.media.ExifInterface
+ import androidx.exifinterface.media.ExifInterface

Avoid using android.media.ExifInterface; use androidx.exifinterface.media.ExifInterface instead

This has been deprecated due to the security issue. Its better to replace it.check this

Also IDE recommends : Avoid using android.media.ExifInterface; use androidx.exifinterface.media.ExifInterface instead

@nicolas-raoul nicolas-raoul changed the title Fix costum picker not consider rotated image Fix custom picker not consider rotated image Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rotated+uploaded pic not considered uploaded by custom picker
3 participants