I am on stable ffimageloading v 2.2.5 with my Xamarin.forms app and i found following error:
Image loading failed: /var/mobile/Containers/Data/Application/97C5C455-8300-4659-BD3F-9E1B1287B524/Documents/Sample/img_45fd2d11-247c-42c5-80a8-f00c6a2320ac.jpg;
System.IO.FileNotFoundException: /var/mobile/Containers/Data/Application/97C5C455-8300-4659-BD3F-9E1B1287B524/Documents/Sample/img_45fd2d11-247c-42c5-80a8-f00c6a2320ac.jpg
at FFImageLoading.DataResolvers.BundleDataResolver+<Resolve>d__1.MoveNext () [0x00456] in <f866fc50aabd449da0e25c454a95fbec>
I am taking picture from camera and then set the image source to the camera picture.
If i use Xamarin.Forms image control then it works fine. So looks like it does not load the local image correctly.
Is this on iOS? I have the same problem with Images in bundled images
Strange thing is it suddenly appeared
System.IO.FileNotFoundException: menu_more
at FFImageLoading.DataResolvers.BundleDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x00094] in <291cd24bfe5e4b67a74af72c2b1b9eab>:0
at FFImageLoading.Work.ImageLoaderTask`2+<RunAsync>d__104[TImageContainer,TImageView].MoveNext () [0x001bd] in <fd86d5a14bae47e99bf3a46d1c691dc0>:0
2016-11-24 19:24:09.003 Ji
stTV[72650:2350462] Image loading failed: menu_more
System.IO.FileNotFoundException: menu_more
at FFImageLoading.DataResolvers.BundleDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x00094] in <291cd24bfe5e4b67a74af72c2b1b9eab>:0
at FFImageLoading.Work.ImageLoaderTask`2+<RunAsync>d__104[TImageContainer,TImageView].MoveNext () [0x001bd] in <fd86d5a14bae47e99bf3a46d1c691dc0>:0
2016-11-24 19:24:09.005 JistTV[72650:2350462] Image loading failed: menu_more
System.IO.FileNotFoundException: menu_more
at FFImageLoading.DataResolvers.BundleDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x00094] in <291cd24bfe5e4b67a74af72c2b1b9eab>:0
at FFImageLoading.Work.ImageLoaderTask`2+<RunAsync>d__104[TImageContainer,TImageView].MoveNext () [0x001bd] in <fd86d5a14bae47e99bf3a46d1c691dc0>:0
Thread finished: <Thread Pool> #21
Yes @escamoteur it is on iOS.
Did it came out of the blue too? Meaning did it work before?
Same here, worked fine before, but without any changes suddenly a FileNotFoundExcept铆on is thrown.
Made a PR this morning https://github.com/luberda-molinet/FFImageLoading/pull/398
Only problem is that @daniel-luberda seems to me on vacation or so.
Could it be that you too did not add a file extension like .png? If you add it it works
The filename contains the extension .jpg, I also try to display jpg files taken from the camera, my exception looks like the one @softsan posted.
This might be another problem. Do you use James Montemagnos Plugin.MultiMedia to take the picture?
Yes, I'm using the plugin by James Montemagno.
But the problem occures not only with "freshly taken" pictures, also with pictures that have been in the storage for a while, so I don't think this is related to the media plugin.
Best thing you could do, clone the whole Repo and Add your code to the SampleProject, then debug into the library
I have same problem on iOS with version 2.2.5... except I am not loading image from bundle but from other file. This is loading code:
cachedImage.Source = FileImageSource.FromFile(path);
everything works fine on android and also if i use Xamarin.Forms.Image instead of CachedImage.
Did you provide file extensions?
Could you provide a small Sampleproject?
I was just browsing the issues and realised that I also reported on this along with a sample project to reproduce here: https://github.com/luberda-molinet/FFImageLoading/issues/403
@CliffCawley seems to have same issue. This is my stacktrace (I can also provide sampleproject, but @CliffCawley already sent one for the same issue):
System.IO.FileNotFoundException: /Users/richard/Library/Developer/CoreSimulator/Devices/F5B3AD77-BF12-4DE6-8EC8-A02CEB1B817B/data/Containers/Data/Application/E189B963-0D7E-480C-8F3D-67467E7D01A9/Documents/image.png
at FFImageLoading.DataResolvers.BundleDataResolver+<Resolve>d__1.MoveNext () [0x00456] in <f866fc50aabd449da0e25c454a95fbec>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3969/44931ae8/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3969/44931ae8/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /Users/builder/data/lanes/3969/44931ae8/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /Users/builder/data/lanes/3969/44931ae8/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/3969/44931ae8/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at FFImageLoading.Work.ImageLoaderTask`2+<RunAsync>d__108[TImageContainer,TImageView].MoveNext () [0x00278] in <a416168fff164cdaa40bb47a6b0de7c7>:0
@CliffCawley @w0301 sure that your files are not bundled resources?
Because it uses the BundelDataResolver
I have it as a bundled resource only for ease of use in the sample. I copy it out to the file system and then load that.
@escamoteur yes I am sure. This is code that downloads and then loads file:
Task.Factory.StartNew(() =>
{
var request = WebRequest.Create(url);
using (var response = Task.Factory.FromAsync<WebResponse>(request.BeginGetResponse, request.EndGetResponse, null).Result)
{
using (var stream = response.GetResponseStream())
{
using (var outStream = streamCreator.OpenFile(path))
{
int read = 0;
byte[] buffer = new byte[16 * 1024];
while ((read = stream.Read(buffer, 0, buffer.Length)) > 0)
{
outStream.Write(buffer, 0, read);
}
}
}
}
Device.BeginInvokeOnMainThread(() =>
{
cachedImage.Source = ImageSource.FromFile(path);
image.Source = ImageSource.FromFile(path);
});
});
Here is sample project which should show 2 images - one in CachedImage view and one in Image view. The one in Image view is shown, but the in CacheImage is not:
FFImageIssue.zip
Then it looks that the wrong DataResolber is used
My callstack is slightly different too
yeah but both have this here
at FFImageLoading.DataResolvers.BundleDataResolver+
did anybody of you clone the project and try to debug?
No I haven't. Can you point us to the code which is picking up data resolver?
unfortunately no, I'm not deep enough in the code. Perhaps I find later a bit of time, but if yu put a breakpoint in the Resolvemethod that fails you could easily check the stacktrace
I will try to debug it sometime tomorrow. I just scan the code and it seems that wrong ImageSource is set somewhere during loading, so DataResolverFactory is returning wronh DataResolver : https://github.com/luberda-molinet/FFImageLoading/blob/master/source/FFImageLoading.Touch/DataResolvers/DataResolverFactory.cs
@w0301 I believe the latest pre-release already fixes this. It seems that the BundleResolver was being used instead of the FileDataResolver. #403. I loaded up the test project in #403, updated to latest pre-release nugets and the correct resolver is being used. PR #398 will fix a separate issue regarding file extensions and the BundleResolver but the latest pre should do the trick for your use case.
PS. Just tested with your repo and updating to latest pre does work.
thanks for clarify this
OK. That is great. Thanks for info.
It should be fixed (prerelease). If you experience this, please reopen. Thanks! :)
Hi, I'm experiencing the same problem. Error:
Image loading failed: /storage/emulated/0/myFolder/images
System.IO.FileNotFoundException: /storage/emulated/0/myFolder/images
05-31 10:03:32.357 I/mono-stdout( 9346): System.IO.FileNotFoundException: /storage/emulated/0/myFolder/images
at FFImageLoading.DataResolvers.ResourceDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0005b] in C:\projects\ffimageloading\source\FFImageLoading.Droid\DataResolvers\ResourceDataResolver.cs:29
at FFImageLoading.Work.ImageLoaderTask`2+<RunAsync>d__109[TImageContainer,TImageView].MoveNext () [0x001eb] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:430
05-31 10:03:32.357 I/mono-stdout( 9346): at FFImageLoading.DataResolvers.ResourceDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0005b] in C:\projects\ffimageloading\source\FFImageLoading.Droid\DataResolvers\ResourceDataResolver.cs:29
05-31 10:03:32.357 I/mono-stdout( 9346): at FFImageLoading.Work.ImageLoaderTask`2+<RunAsync>d__109[TImageContainer,TImageView].MoveNext () [0x001eb] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:430
Do you have a solution? I'm developing on Android. Thanks!
@peppe130 You need correct app permissions to access /storage/emulated/0/myFolder/images
Dear Daniel,
I have a big problem with your library.
I have a device with an app that use your package and load web image and work very good.
Then I have the same app that need to use local (in external folder) images (the same of web) but, when I set path into binding, I don鈥檛 see images.
<ffimageloading:CachedImage x:Name="imageCat"
FadeAnimationEnabled="true"
Source="{Binding Path}"
HeightRequest="80"
DownsampleToViewSize = "true"
RetryCount = "5"
RetryDelay = "250"
/>
I tried also to use Reload after set Source
imageCat.Source = ImageSource.FromFile(((CatMercInfo)BindingContext).Path);
imageCat.ReloadImage()
but I have the same result鈥othing error but nothing images.
Can I solve?
@giuliorisi have you managed to solve this?
UPD: Okay, I solved it. It seems FFImageLoading fails if the Source property is set to something like "file:///blah/blah/blah". The source string should not contain "file://" scheme.