CaiJingLong / dart_image_size_getter

Use dart file api to get image size, needn't use decode. just read the metadata.
Apache License 2.0
64 stars 29 forks source link

Can't get size image #2

Closed SiNguyen0604 closed 2 years ago

SiNguyen0604 commented 3 years ago

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 ?

CaiJingLong commented 3 years ago

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

eduardo-cervantes commented 3 years ago

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

zbejas commented 3 years ago

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);