How to save images in the background

Hi,

I’m making an app that takes image, adds labels and then saves them to be viewed later.
We currently save the images in a stored list which works well but the app starts crashing after 8-9photos. We’ve also tried saving the images in databases etc.

We want to try using the cloudinary API to compress the images while saving. However this means saving images now takes an average of 30seconds which is too slow.

Just wondering if we can do the image save in the background, or does anyone have a better idea? :slight_smile:

Hi Maria,

I interpret from your post that you are storing the file in a database or Cloudinary and storing only the url in Thunkable variables. This is how I would do it also.

your typical Cloudinary URL looks like this:
https://res.cloudinary.com/luco-cloudinary/image/upload/v1600387707/sample.jpg

Replace the version number with a transition and just call the new url.

For example the above url could be
https://res.cloudinary.com/luco-cloudinary/image/upload/w_200/sample.jpg

Thunkable allows relatively easy parsing of text so you should be able to play around with Cloudinary URL’s and do all sort of wonderful things and it is very quick.

Have a look at Cloudinary transitions by URL in their documentation.

1 Like

How large are your files?

The issue is the upload size. Not downloading. We need a way to be able to control client side photo quality.

1 Like

They are images taken using the camera component.

@jared, is there a way I can do this?
We tried making the image smaller by setting height and width…which helped slightly but obviously not a great/long-term fix :frowning:

Sorry for the misunderstanding that @jared correctly pointed out.

I can’t see a way of controlling the resolution or hence the upload times but I have had no problem loading in the background using a dedicated screen and navigating away from it before calling the function in it. I hope this helps. I have made a simple app to demonstrate.

https://x.thunkable.com/projectPage/5f69291b3f0990e9cbe2ab59

5 Likes

Thanks! This worked perfectly!

1 Like

Hey @eddie.rebehy, what is the counter for? Am I missing the purpose?

This is a cool idea! I like it a lot!!

1 Like

hi @jared,

the counter was just an arbitrary ‘do something’ demonstration to show foreground activity while background loads image on second screen.

2 Likes