coil-kt / coil

Image loading for Android and Compose Multiplatform.
https://coil-kt.github.io/coil/
Apache License 2.0
10.82k stars 664 forks source link

Fix Uri handling of Windows file paths. #2404

Closed colinrtwhite closed 3 months ago

colinrtwhite commented 3 months ago

Fixes: https://github.com/coil-kt/coil/issues/2014

This is a slight tweak of @Caij's code that parses the code into a spec-compliant URI. Uri.path still behaves according to the URI spec (i.e. always uses /) so we introduce filePath, which formats the URI according to the file system's native separator.