Skip to content

Conversation

@pavelbazika
Copy link

@pavelbazika pavelbazika commented Jan 14, 2019

When thumbnail creation is requested, but the original image URI does not have file:// but content:// scheme, method neededRotation did not worked. getAbsolutePath() does not return valid path in such case and ExifInterface returns orientation 0 (at least on Samsung S6).

IMHO ContentResolver should be used to access the data. However ContentResolver provides InputStream, but native ExifInterface has only File accepting constructor. Luckily the ExifInterface in support library accepts also a stream, so I used it.

@federicoiosue
Copy link
Owner

Hi @pavelbazika that's really great!

Would you be able to provide an instrumentation test for that too?

@pavelbazika
Copy link
Author

Hi,

I can try it, but as I do Android development just for fun, I haven't used the Android testing framework yet. So I'll (finally) check how the tests are done on Android and let you know. But it will take some time...

@pavelbazika
Copy link
Author

Hi,
so I studied how unit testing is done on Android, but I cannot find any single test in simplegallery repository to follow. As I did not write any tests yet, I'm afraid I'll not be able to start with it correctly.

Moreover, my pull request is just a fix, not a new feature. So if some test already exists somewhere, I'm able to update it, but if you would like me to write a test from scratch, I cannot help with it unfortunately.

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.

2 participants