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 {
|
} finally {
|
||||||
Glide.with(activity).clear(target);
|
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
|
// we convert the image on platform side first, when Dart Image.memory does not support it
|
||||||
FutureTarget<Bitmap> target = Glide.with(activity)
|
FutureTarget<Bitmap> target = Glide.with(activity)
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
|
|
|
@ -60,8 +60,9 @@ object MimeTypes {
|
||||||
|
|
||||||
// as of Flutter v1.22.0
|
// as of Flutter v1.22.0
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun isSupportedByFlutter(mimeType: String) = when (mimeType) {
|
fun isSupportedByFlutter(mimeType: String, rotationDegrees: Int?) = when (mimeType) {
|
||||||
JPEG, PNG, GIF, WEBP, BMP, WBMP, ICO, SVG -> true
|
JPEG, GIF, WEBP, BMP, WBMP, ICO, SVG -> true
|
||||||
|
PNG -> rotationDegrees ?: 0 == 0
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue