CaiJingLong/dart_image_size_getter

Can't get size image

Closed this issue · 3 comments

Hi @CaiJingLong @JiachenRen
I can;t get size image when use image_size_getter.
this is error when me get size .
The following FileSystemException was thrown attaching to the render tree:
Cannot retrieve length of file, path = 'assets/images/123.jpg'
this my code
final file = File('assets/images/123.jpg');
final size = ImageSizGetter.getSize(file);
Can you help me ?

Hi, the package is dart package, no just flutter.
I think you need convert flutter asset to dart file.

Hello @SiNguyen0604,
Did you try to use final size = ImageSizGetter.getSize(FileInput(file));?

Hello. I have the same issue. It works fine on my Oneplus 6, but doesnt work at all on a Huaweii p30 pro. I have traced back the issue to image size.

io.File(widget.directory).exists().then((value) => print('File: $value'));
imageSize = ImageSizeGetter.getSize(FileInput(File(widget.directory)));
print(imageSize);