-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(5.0.3): Images not showing #168
Comments
Sometimes images are shown, sometimes they don't. I have a share button that gets the image from the cache so I know images are downloaded and saved, but for some reason the component never gets the "finished" status and keeps showing the spinner. |
|
More details about this error:
|
On first run, something is happening in
|
Hi, same issue over here. Any news? |
What i'm seeing is that the files are created with 0 filesize. |
@gmosornoza but it only happens the first time, if you close your app (fully close it) and then navigate to another page that has |
@eduardoRoth Not for me. In fact, first time only shows the fallback Image. If i close and reopen the app, then it shows the image as broken image. Checking the cache directory in the device i noticed the zero filesize. |
This happens with |
@felixbroehl could you take a look at this? |
Did this worked before my changes were merged? Which platforms did you tested? I'm unable to reproduce such problems with my devices. |
@felixbroehl I'm using the plugin as is. Android Oreo device, |
window.resolveLocalFileSystemURL is rejecting with errorCode 1, in @ionic-native/file. I trace until this: File.prototype.resolveLocalFilesystemUrl = function (fileUrl) { |
@felixbroehl Samsung S8 - Oreo 8.0.0 ionic info
package.json Dependencies
|
hmm, ok. personally i'm using it with an older cordova version. @eduardoRoth was 5.0.2 working for you with 8.0.0? If not this is not related to my latest changes, but i will try to investigate. If 5.0.2 showing the same behavior i think its related to the copying into a temp directory in the getCachedImagePath function. As @gmosornoza pointed out he traced it back to this.file.resolveLocalFilesystemUrl which is used in getCachedImagePath. |
@gmosornoza @felixbroehl checked my app settings and found that it had the "Storage" permission off, so I turned it on and tried again with no result... So I disallowed it again and suddendly it started working... really strange Will check on it further... |
ok this is strange :D |
seems more like a problem with cordova than with this plugin |
Cleared cache again for my app and tried again... same problem 😢 |
this could be related to danielsogl/awesome-cordova-plugins#806 |
could you try this hack described by joewoodhouse? danielsogl/awesome-cordova-plugins#505
|
@felixbroehl was just trying this change, and it seems to partially fix this issue. I need to use Tried both ways, with and without setMaximumCacheSize #27 (comment) Is there any drawback to have the |
@gmosornoza could you try both fixes and see if it works for you know? |
maybe this also is related to "if(this.shouldIndex)" and no else in your example |
because this.shouldIndex is defined by the maximumCacheSize |
Yeah, just removed that Why is there this property? @ihadeed |
also wtf is this: |
there should be something like this:
|
@eduardoRoth can you test it? |
It doesn't work for me. The files were downloaded, but when they are written to the filesystem, the filesize keeps 0. I setup the maximum cache size, tried to move cordova.js after polifyll but no success. Edit: I get FileError code 1. |
@felixbroehl made the following change instead: this is using your updated condition
Check if we have enough space in cache, if not, make some more removing the oldest one.
|
maybe we should rename shouldIndex to isCacheSizeExceeded or something like that |
Hi, It worked changing the order of cordova.js and polifyll.js. @eduardoRoth I was doing it wrong! The file to be edited is under /src/index.html (i was editing www/index.html) Thank you all, it's working fine now. |
@felixbroehl same problem on Android 7.0.1 |
so maintainCacheSize already checking this. So I created a fork for this: https://github.com/felixbroehl/ionic-image-loader Can somebody test this? |
Also created a fork with this change, but removed Tested in device and emulator and works. This does not fixes the Pull request #171 |
Your fork seems good. I think we should document the polyfill.js workaround in the README and also ask @ihadeed to evaluate if there are consequences. To bring @ihadeed up to date: It seems like the @ionic-native/file or cordova-plugin-file is not working correctly (promise resolve of this.file.writeFile is not called). Therefor images are not loaded on the first time. changing the order of cordova.js and polyfill.js in the src/index.html seems to do the trick. |
Created PR #173 with suggested |
I'll review the PRs soon.
|
Images are downloaded but not updated on screen. Images seem to be cached but not shown.
I'll update as soon as I have more detail.
The text was updated successfully, but these errors were encountered: