use glide to get quick thumbnails of flipped images
This commit is contained in:
parent
ae2f8d3ae7
commit
ebda5a9ba9
1 changed files with 12 additions and 7 deletions
|
@ -88,14 +88,19 @@ public class ImageDecodeTask extends AsyncTask<ImageDecodeTask.Params, Void, Ima
|
||||||
if (w == null || h == null || w == 0 || h == 0) {
|
if (w == null || h == null || w == 0 || h == 0) {
|
||||||
p.width = p.defaultSize;
|
p.width = p.defaultSize;
|
||||||
p.height = p.defaultSize;
|
p.height = p.defaultSize;
|
||||||
try {
|
// EXIF orientations with flipping are not well supported by the Media Store:
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
// the content resolver may return a thumbnail that is automatically rotated
|
||||||
bitmap = getThumbnailBytesByResolver(p);
|
// according to EXIF orientation, but not flip it when necessary
|
||||||
} else {
|
if (!p.isFlipped) {
|
||||||
bitmap = getThumbnailBytesByMediaStore(p);
|
try {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
|
bitmap = getThumbnailBytesByResolver(p);
|
||||||
|
} else {
|
||||||
|
bitmap = getThumbnailBytesByMediaStore(p);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
exception = e;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
exception = e;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue