-
-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throws exception when content-type is not image #4
Comments
Hi FastNinja, Thanks for your response. When I made this I was already unsure how to make this. For now I made this just for images and expected the http header to give the right extension. There is not really a need to have this only working for images though. What I was not sure about is whether I need to save the file with an extension. I think I can just ignore that all completely and just save the file with a random string as filename. If I am correctly the ImageWidget also ignores that and just retrieves the codec from the databytes. I would propose to just remove the whole content-type header check and save the file without an extension. Especially because it is just for caching web data and not really for any user interaction further on. However, I am not sure how happy Android and iOS are with files without an extension. What do you think? |
Yes, @renefloor I took you files, commented out all the lines related to content-type and all images worked!
However...I found that you So I did one extra step - I took another package https://github.com/FaisalAbid/pluto and changed it a bit. |
Thanks for testing @FastNinja. I will take the header issue to #5 |
@renefloor Pluto did not accept |
You could also make a pull request for Pluto that it accepts an imageprovider. Maybe I'll do that myself. Creating your own version of Pluto also means both have to be maintained. |
Hi there,
Great idea - I almost implemented my own cache manager and then found your package.
However I am stuck with the following problem:
I found the root cause:
I do not see why would you want to check the
content-type
at all. I would assume that people who pass URL have to make sure it is image....Would you accept pull request where check
if (type[0] == "image")
is removed?P.S. image was uploaded to Firebase Storage using Flutter Firebase plugin that autodetects the content type and guesses it wrong 50% of the time.. I will look into fixing that plugin too - but it will require porting native code and also approval from official flutter team later..
Look forward.
The text was updated successfully, but these errors were encountered: