Forum Academy Marketplace Showcase Pricing Features

Bulk resize images in DB

I made the mistake of not constraining images uploaded by users and have racked up 6GB+ of images in a few days :grimacing: Is there a way I can bulk resize all the images in the database? Each image is referenced in a User field.

Two things I don’t understand about it:

How to create a workflow to make changes to each user in the database
I can’t see any action that would allowing resizing, just Imgx setting the compression quality which I already did and didn’t stop 5,000px wide images

Hello @ryan19

Explore a service called publitio or any other service where you can send the image and get it back compressed. Or even better … hosted there and if it allows you to change the size of the image dynamically even better! (Publitio does this)

As for “fixing” the current ones you would have to build logic and api calls to extract / transform / re-save them to your dB … or to just host them in an external service.

Hey @ryan19,

TinyPNG provides API’s to compress and resize images. Maybe you can use one of these options:

  1. There is a free plugin which can compress images. Maybe Olivier Coolen who created this plugin is willing to add the option to resize images.
  2. It is possible to see the plugin code for the plugin above (see the link), so using that as an example together with the documentation for the TinyPNG API you might be able to add the the resize option to your app using Bubble’s API connector plugin.
  3. There is a paid plugin for TinyPNG which already has the option to resize images.

N8N.io (does automation like Zapier and Make) als provides the option to resize images. Since a couple of weeks/months they have a desktop version so you can easily play around with it.

1 Like

I have a plugin where you can convert 1500 compressions for free (with their API).

Plugin Page | Plugin Demo

1 Like

Great; thanks for the suggestions @cmarchan @gerbertdelangen @GhostCodes

This might sound basic but how do I go about looping/iterating over each user in a backend workflow?

2 Likes

Hello @ryan18

This post is about a different context but focus on the logic of the loop (recursive backend workflow): :smiley:

Hey @ryan18 , simple answer:

Create a backend workflow that deletes/updates/modifies

Set a parameter to the thing you’re trying to modify.

Setup your actions.

Create a scheduled API workflow ON A LIST.

When you configure that API Action, use Current Group or Current Cells, or Do a Search for you thing.

Should do the trick.

I use Croppie plugin. You can setup the maximum file size in bytes or compress when save which is not higher than 250Kb (usualy is 100kb to 150kb) a picture from mobile. You can show a popup when the image is too large as well.