Hi guys, so i have an app in the works that will heavily utilise the camera to take multiple photos - it could be anywhere between 20-30 photos per “journey”, and my experience in the past with Ionic 1 + the camera has been sketchy with even one photo.
Users can create “Journeys”, then store them offline before “publishing” them to the server - so obviously i want data to persist between app usage. I’m intending to use localStorage
to avoid having to set up SQLite - oh how i hate SQLite.
So there are multiple questions i have, along with an approach i was going to use but might not. I’ll explain each question as i go along to explain why i’m confused.
- Can you store a photo file on the filesystem and display it in the app without having to convert it back to a base64 encoded string?
Or does it not matter? My worry is a user adding photos to the “journey” and adding 5-10 photos of one spot, then will having all those images in memory as base64 strings affect the performance of my app?
If it matters, the user taps “Add point”, which brings up a modal, and from there they can enter details about the point and add photos - and as you add the photos, it displays the thumbnails.
- What do you do about potential leftover files in the filesystem?
I would, in my localStorage information, keep track of filenames that i would need to upload to the server come publishing time - but what about any files that are left orphaned by data corruption or crashes - should i worry about them?
- As much as i hate SQLite, is it a valid alternative to writing files to the filesystem?
Could i say, create a table that would be used to store these images as base64 encoded strings, then retrieve them from there rather than the filesystem?
Is there a massive speed difference? Are there more limitations? Would i lose metadata?
I’m hoping to create an NPM package after this that simplifies working with images, their storage and retrieval, so your answers will hopefully help me give something back.
Thanks all.
Dan.