question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid argument(s): File on path is not an image.

See original GitHub issue

Hey guys. There is a problem with URLs that have query params such as facebook images firebase storage images, etc. For image on this link: (https://scontent.flju2-1.fna.fbcdn.net/v/t1.0-9/71515447_2410538489194566_4191628866734784512_n.jpg?_nc_cat=1&_nc_oc=AQlh0ua3e1wQE5YN8CLL1ebDQSVhN9U-xa1k23i8dgUqMQX5apqyNxsYsWYJx65dbBM&_nc_ht=scontent.flju2-1.fna&oh=c2036dc3070d4c1fcd6b17e73c9ab6ad&oe=5E3176F8) library spews out Unhandled Exception: Invalid argument(s): File on path is not an image.

I didn’t go too deep into debugging, but I’d say that bool isImage(String path) => imageFormats.contains(extension(path).toLowerCase()); returns false, because extension(path) call doesn’t handle extensions okay, when there are query params involved. 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
shrijanRegmicommented, Jul 18, 2020

@jok3erc0ncy30 Use this instead…

https://pub.dev/packages/image_downloader Works for any images and video. Best package ever

0reactions
lecicdjurocommented, Aug 7, 2021

resolved

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid argument(s): No host specified in URI file - flutter
I'm getting the below error in my code when I try to display the profile image which is connected through ...
Read more >
Getting “Invalid argument” error when attempting to check ...
My first guess is that pngcheck expects a path to a file, not a pattern. If you have several files to check you...
Read more >
Invalid argument(s): No host specified in URI file:///null-Flutter
Coding example for the question Flutter Error: Invalid argument(s): No host specified in URI file:///null-Flutter.
Read more >
Calling save on image fails due to file path options not being ...
Image object and then calling save() results in the error: imb_savepng: Cannot open file for writing: '' Invalid argument Error: Python: ...
Read more >
Error codes - AWS Documentation
The command includes two or more incompatible arguments. ... For example, if booting from an enclave image file that is not valid, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found