fullscreen: show PNG rotated according to Exif
This commit is contained in:
parent
120f9cd4e4
commit
c5feba5691
2 changed files with 4 additions and 3 deletions
|
@ -95,7 +95,7 @@ public class ImageByteStreamHandler implements EventChannel.StreamHandler {
|
|||
} finally {
|
||||
Glide.with(activity).clear(target);
|
||||
}
|
||||
} else if (!MimeTypes.isSupportedByFlutter(mimeType)) {
|
||||
} else if (!MimeTypes.isSupportedByFlutter(mimeType, rotationDegrees)) {
|
||||
// we convert the image on platform side first, when Dart Image.memory does not support it
|
||||
FutureTarget<Bitmap> target = Glide.with(activity)
|
||||
.asBitmap()
|
||||
|
|
|
@ -60,8 +60,9 @@ object MimeTypes {
|
|||
|
||||
// as of Flutter v1.22.0
|
||||
@JvmStatic
|
||||
fun isSupportedByFlutter(mimeType: String) = when (mimeType) {
|
||||
JPEG, PNG, GIF, WEBP, BMP, WBMP, ICO, SVG -> true
|
||||
fun isSupportedByFlutter(mimeType: String, rotationDegrees: Int?) = when (mimeType) {
|
||||
JPEG, GIF, WEBP, BMP, WBMP, ICO, SVG -> true
|
||||
PNG -> rotationDegrees ?: 0 == 0
|
||||
else -> false
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue