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) {
|
||||
p.width = p.defaultSize;
|
||||
p.height = p.defaultSize;
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
bitmap = getThumbnailBytesByResolver(p);
|
||||
} else {
|
||||
bitmap = getThumbnailBytesByMediaStore(p);
|
||||
// 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);
|
||||
} else {
|
||||
bitmap = getThumbnailBytesByMediaStore(p);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
exception = e;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
exception = e;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue