Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Redth committed Mar 24, 2023
2 parents c614025 + f668a93 commit 0bddc81
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using System.Threading.Tasks;
using FFImageLoading.Helpers;
using System.Threading;
using Foundation;
using Microsoft.Maui.Storage;

namespace FFImageLoading.DataResolvers
{
Expand Down Expand Up @@ -37,10 +39,31 @@ public virtual Task<DataResolverResult> Resolve(string identifier, TaskParameter

if (string.IsNullOrEmpty(file) && FileStore.Exists(identifier))
{
file = identifier;
}
file = identifier;
}

// Let's check the bundle and bundle resource paths too
foreach (var bu in NSBundle._AllBundles)
{
var path = Path.Combine(bu.ResourcePath, identifier);

if (File.Exists(path))
{
file = path;
break;
}

path = Path.Combine(bu.BundlePath, identifier);

if (File.Exists(path))
{
file = path;
break;
}
}


token.ThrowIfCancellationRequested();
token.ThrowIfCancellationRequested();

if (!string.IsNullOrEmpty(file))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using System.Threading.Tasks;
using FFImageLoading.Helpers;
using System.Threading;
using Foundation;
using Microsoft.Maui.Storage;

namespace FFImageLoading.DataResolvers
{
Expand Down Expand Up @@ -40,6 +42,27 @@ public virtual Task<DataResolverResult> Resolve(string identifier, TaskParameter
file = identifier;
}

// Let's check the bundle and bundle resource paths too
foreach (var bu in NSBundle._AllBundles)
{
var path = Path.Combine(bu.ResourcePath, identifier);

if (File.Exists(path))
{
file = path;
break;
}

path = Path.Combine(bu.BundlePath, identifier);

if (File.Exists(path))
{
file = path;
break;
}
}


token.ThrowIfCancellationRequested();

if (!string.IsNullOrEmpty(file))
Expand Down

0 comments on commit 0bddc81

Please sign in to comment.