rowy icon indicating copy to clipboard operation
rowy copied to clipboard

Image field settings - add ability to toggle compress on/off

Open harinij opened this issue 3 years ago • 10 comments

Is your feature request related to a problem? Please describe. Currently we support compression by default for image field. Add ability for users to turn it off in the Image settings if they do not want a compression

harinij avatar Oct 01 '21 08:10 harinij

An unknown error occurred when uploading an image using the image field.

https://github.com/rowyio/rowy/discussions/965

RajGM avatar Nov 13 '22 17:11 RajGM

I solved it by deleting and creating a new project and enabling cloud storage. Now the image is uploading, but Rowy can't access it. Even though firebase rules allow access to it.

rules_version = '2'; service firebase.storage { match /b/{bucket}/o { match /{allPaths=**} { allow read, write: if request.auth.token.roles.size() > 0; } } }

RajGM avatar Nov 21 '22 12:11 RajGM

@notsidney

RajGM avatar Nov 21 '22 12:11 RajGM

I would like to work on it.

Abhishek-90 avatar Aug 12 '23 07:08 Abhishek-90

Hello @harinij

I created a new table with a column to upload images. Currently clicking the upload button directly opens the image browser and uploads directly on selecting the image. Do we want to create an intermediatory upload modal with an option to check/uncheck image compression? Or is there any other method we have thought of?

Abhishek-90 avatar Aug 13 '23 06:08 Abhishek-90

Hi @Abhishek-90 good point. It can be part of the "Column config" modal. Currently, this is disabled for the Image field. You can take a look at the Short text field as an example and use the similar modal as that for the column config which has a check box for image compression. That way, user can configure if they want all the images to be compressed in that column or not. Once this setting is enabled in the column config, all the images uploaded in the column will have compression on. We can have compression ON by default on the config and it can be unchecked by the user to turn it off.

harinij avatar Aug 14 '23 01:08 harinij

Okay @harinij , I have understood the approach. Currently, I am done setting up rowy locally and started debugging the code. I will keep updating on the progress here and clear my doubts on discord server

Abhishek-90 avatar Aug 15 '23 08:08 Abhishek-90

Hello @harinij, Please find update on this issue so far.

Changes Done: I have enabled Column Config for ImageFields - I created a new Settings.tsx component for image field and added the checkbox to turn on/off for image compression (default is on,please refer below screenshot)

progress

Next Steps:

  1. When the checkbox is checked/unchecked I will store the appropriate boolean true/false using atom.
  2. Depending on this state returns I will apply compression.

Question: Once user checks/unchecks, how do we keep it consistent? should I use localStorage to keep it consistent between different session? or should I store their preference in Firebase?

Abhishek-90 avatar Aug 16 '23 13:08 Abhishek-90

Hi @Abhishek-90 I am facing an issue regarding image compress. So can you please explain it in brief.

ankitprajapati08 avatar Aug 22 '23 08:08 ankitprajapati08

@ankitprajapati08 Hello, what issue are you facing?

Abhishek-90 avatar Aug 28 '23 12:08 Abhishek-90