Created
August 12, 2023 13:03
-
-
Save russellbits/bd68751b6b8e51c5eb4e0b885655d554 to your computer and use it in GitHub Desktop.
Supabase image resize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { data } = supabase.storage | |
.from('public-bucket') | |
.getPunlicUrl('folder/avatar-1.png', { | |
transform: { | |
width:100, | |
height:100, | |
resize:'cover' // Can be values of cover (defaul) | contain | fill | |
// cover crops to frame size | contain keeps aspect ratio inside frame | fill stretches image to fill frame | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment