Conversation
lib/src/types.dart
Outdated
@@ -205,3 +205,46 @@ class StorageRetryController { | |||
_cancelled = true; | |||
} | |||
} | |||
|
|||
enum TransformCrop { fill, fit, fillDown, force, auto } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about some documentation about these options? Or should they only be documented on the supabase docs website?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you're right. Let me add more documentations around these types and more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Vinzent03 I also wonder if TransformCrop
is a good name... Which one do you think is the best?
- TransformCrop
- CropOption
- CropType
- CropMethod
or other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally kind of like CropOption
now that I see a few options like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like mode
is the term used across industries. I think I will go with ResizeMode
here after, but what do you think?
https://docs.imgix.com/apis/rendering/size/fit
https://cloudinary.com/documentation/resizing_and_cropping#resize_and_crop_modes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just chatted with the storage team and confirmed that cover
, contain
, and fill
are the finalized resize modes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay great. I really like the images in the documentation of BoxFit in Flutter. Do you think we can do the same for the resize modes? Or do you think that's overkill.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dshukertjr In case you missed the above message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Vinzent03 Thanks for pinging me! Yeah, that is a great idea! Let me add something similar!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it might be a bit time consuming, so let's come back to that nice idea after launch week!
Co-authored-by: Bruno D'Luka <45696119+bdlukaa@users.noreply.github.com>
Just an FYI, there will most likely be some last minute API change on the storage-js side. Specifically, we might not deprecate |
Co-authored-by: Vinzent <vinzent03@proton.me>
We will release a new version of storage-dart tomorrow. Will update the change logs and stuff so that we can release this version right after merging this PR! |
What kind of change does this PR introduce?
New image transformation feature will be added to Supabase. This PR adds support for that feature.
transform
option has been added togetPublicUrl
andcreateSignedUrl
methods.download
method has been deprecated in favor ofpublicDownload
andauthenticatedDownload
methods.supabase-js code here
supabase/storage-js#129
What is the current behavior?
Image transform is not supported
What is the new behavior?
Image transform feature is supported where images stored on Supabase storage can be resized on the fly.
We will hold off on merging this until this PR is merged on storage-js.