How to load a tif image in flutter web?

Viewed 138

How can i read a .tif image as a Image widget in flutter?

Since tif is not supported by default in flutter, there is any package or method that can load and decode a tif image?

1 Answers

Saw this kind of question some time ago...

You can decode the image and encode it as png like

import 'package:image/image.dart' as imgLib;
imgLib.Decoder dec = imgLib.findDecoderForData(response.data);
Image.memory(imgLib.encodePng(dec.decodeImage(response.data)))

You can then display the png in Image.

Cheers!!

Related