use glide to get quick thumbnails of flipped images

This commit is contained in:
Thibault Deckers 2020-10-16 19:30:01 +09:00
parent ae2f8d3ae7
commit ebda5a9ba9

View file

@ -88,6 +88,10 @@ public class ImageDecodeTask extends AsyncTask<ImageDecodeTask.Params, Void, Ima
if (w == null || h == null || w == 0 || h == 0) {
p.width = p.defaultSize;
p.height = p.defaultSize;
// EXIF orientations with flipping are not well supported by the Media Store:
// the content resolver may return a thumbnail that is automatically rotated
// according to EXIF orientation, but not flip it when necessary
if (!p.isFlipped) {
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
bitmap = getThumbnailBytesByResolver(p);
@ -98,6 +102,7 @@ public class ImageDecodeTask extends AsyncTask<ImageDecodeTask.Params, Void, Ima
exception = e;
}
}
}
// fallback if the native methods failed or for higher quality thumbnails
try {