CarnegieTechnologies / gallery_saver

Flutter plugin that saves images and videos to devices gallery
Apache License 2.0
157 stars 313 forks source link

Migrate deprecated Thumbnail calls in Android Implementation. #90

Open VOIDCRUSHER opened 3 years ago

VOIDCRUSHER commented 3 years ago

@jelenalecic Thanks for your work on #85 . I noticed in the implementation that the Android plugin is still calling getThumbnail whereas the Android documentation shows that this call has been deprecated in favor of ContentResolver.loadThumbnail as of API 29 and that carries also implications for likewise deprecated usage of MediaStore.Images.Thumbnails.KIND, MediaStore.Images.Thumbnails.MICRO_KIND, MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI in storeThumbnail.

I'm not a dedicated Android developer but from what I understood, saving Thumbnails to external storage like this might no longer be supported moving forward? In which case, those relevant bits of code could be removed along with any other deprecated code before it breaks entirely when they do get removed. I'm not sure when this will happen but API 29 will be the minimum supported version on the Google Play Store starting in August of this year.

Saad29 commented 3 years ago

I have also experienced crashes related to this issue as well! This points to line 84 of the 'FileUtils.kt' of the package , which uses the 'getThumbnail()' method that is now deprecated. I got this from the crash logs.

Fatal Exception: java.lang.IllegalStateException miniThumb must not be null