Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ class PdfImageRendererPlugin : FlutterPlugin, ActivityAware, MethodCallHandler {
private fun getURI(uri: String): Uri {
val parsed: Uri = Uri.parse(uri)
val parsedScheme: String? = parsed.scheme
return if ((parsedScheme == null) || parsedScheme.isEmpty()) {
return if ((parsedScheme == null) || parsedScheme.isEmpty() || "${uri[0]}" == "/") {
// Using "${uri[0]}" == "/" in condition above because if uri is an absolute file path without any scheme starting with "/"
// and if its filename contains ":" then the parsed scheme will be wrong.
Uri.fromFile(File(uri))
} else parsed
}
Expand Down