ko2ic / image_downloader

Flutter plugin that downloads images and movies on the Internet and saves to Photo Library on iOS or specified directory on Android.
https://pub.dartlang.org/packages/image_downloader#-readme-tab-
MIT License
92 stars 115 forks source link

Google photos shows image without preview #69

Open vexcode2598 opened 4 years ago

vexcode2598 commented 4 years ago

In google photos when I press my save image button I get 2 photos. One is just a normal photo with preview, correct size, etc. and the other one is just a grey square, meaning it can't load it or it's empty, I don't really know. The grey one has the same size on disk (143kb for example), but google photos says it's less than 50x50. Other gallery apps don't have this issue. Also a couple of my friends don't get it on google photos either. I have this issue on my emulator and on my personal phone. I get this message in the run window and after this I get 3 exact same ones, but they have localUri and mediaType etc. I assumed this one must be the bad file, but it's weird if other people don't face this issue.

D/image_downloader( 9520): RequestResult(id=52, remoteUri=https://images.unsplash.com/photo-1558945657-484aa38065ec?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=933&q=80, localUri=null, mediaType=null, totalSize=-1, title=, description=)

nikolajjsj commented 4 years ago

I also experience this issue

vexcode2598 commented 4 years ago

After more testing with some help from my friends, I'm pretty sure the problems only appears on Android 10. On all android 9 and lower that I've tested there's no such issue. Is there anyone that can help here? I will try to use an older version and let you know if interested

vexcode2598 commented 4 years ago

If someone is stil interested, I manged to fix this issue by adding a custom directory. progress = await ImageDownloader.downloadImage(imageUrl, destination: AndroidDestinationType.custom() ..subDirectory("Axis")); progress = 'Image Saved Succesfully'; That's the main thing I changed, but don't really know how it works, as I am only learning now, from a template flutter app. With this fix, looks like I have to press my button twice in order to do anything so that's needs a clsoer look at as well. But, for what it is, this fixed my main issue.

Daryl149 commented 4 years ago

Same issue with Android 10 Samsung A10, in the default Gallery app. see #75