fullscreen: show PNG rotated according to Exif

This commit is contained in:
Thibault Deckers 2020-10-09 14:07:14 +09:00
parent 120f9cd4e4
commit c5feba5691
2 changed files with 4 additions and 3 deletions

View file

@ -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()

View file

@ -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
}