I added 2 images (1920px width each) to a note.
On desktop everything is fine but it does not load on android.
I see the text “Loading image…” but nothing happens and the app becomes unresponsive. After a while I can use the app again but can’t choose another note. It always stays in the list view as the viewer crashed. I have to force quit the app to see a note again but images are still not loading.
Thank you for the report.
It looks like your android phone is lack of memory.
Does it work with smaller images?
The app needs to encode an image to base-64 which takes larger memory than the image itself so it’s kind of memory-inefficient because it is built with React Native.
I’ll fix it if I found any workaround but I’m afraid that it’s hard to avoid at the moment.
It works, yes.
I inserted two small images on desktop and I was able to view them fairly quickly on mobile.
I just removed the account from my phone and re-added it (so I’m sure the cache is clear - clear cache via Android preferences didn’t do it).
The first time I would see the note with the big images.
Then I clicked on view-mode (eye-icon) and it displayed another note, not the current one with the big images that I selected.
Then I went back to the list-view and I couldn’t view the note with the big images again.
After this I wasn’t able to view any other note and the text “Please select a note or create” appears when I select a note.
Thank you for the answer.
So, it is a memory capacity issue.
The editor and preview crashes when you opened a note with the big images.
I don’t know which model of Android phone you use but I’m afraid that I can’t help you with this issue since it depends on your device.
The main reason is as I answered above.
It sounds strange that it happens on Pixel 3a which has sufficient RAM.
Okay, I’ll look into it.
I’m currently working on the new version of the mobile app, involving fundamental changes right now.
Once I’ve finished this work, I’ll try to reproduce it on my Android phone!
Just to let you know:
I haven’t had the issue for a while now. Perhaps it was something about the file format. Sadly I can’t remember with what application I saved the problematic JPG files.
When it happens again I’ll let you know here.
Thanks.
I have reproduced it several times with my note with some large screenshots on my iPhone XS.
The UI freezes and I can’t open another note.
Inkdrop v5 is about to be released. I’ll work on it after that!
I suspect a reason why the app becomes unresponsive is that the app takes too long time to decrypt images as the decryption process is performed in JavaScriptCore which is not performant or memory efficient.
I guess we need it to be performed in native code to avoid this bottleneck.
It’d be a big challenge though, worth trying it.
Successfully integrated it with the app and it works great.
A 4MB PNG image (3000 × 1688) is displayed without hung up on Android and iOS!
But there is one more thing that can improve the performance further: Native caching.
Because passing images in base64 through SQLite -> RN -> WebView is sooooooo slow.
Images need to be cached in fs and loaded directly from WebView.
I’ll try it.
Wouldn’t this also increase the data storage by nearly 2x? It’s probably still a good compromise to make, CPU time vs storage.
Perhaps there could be an option for image/attachment caching?
No, it wouldn’t increase the local storage usage.
I’m planning to just store images to local storage as files instead of to SQLite database, so they can be loaded directly from WebView via file URI.