I'm using the Firebase Resize Images extension to create 120x120 thumbnails for content, keeping the original images. I was hoping to be able to just store the original full size downloadUrl
on my content and do a downloadUrl.replace('.png', '_120x120.png')
whenever I want to display a thumbnail. Who wants to store 2 different image urls on every piece of content?
So, I configured the extension to "Make resized images public", but the resized images still require a token and it's a different token from the original image, so I can't just get the thumbnail by adding the size params to the original downloadUrl
. If I do, I get a 403 since the tokens are different.
If resized images still require a token, I'm not sure what it means to "Make resized images public". Any guidance? This seems like it would be a pretty common use case, so maybe I'm missing something.
Making a file public allows you to skip using download URLs, which are signed with access tokens that expire.
Instead, you can access files using their public URI, which is of the format:
https://storage.googleapis.com/BUCKET_NAME/OBJECT_NAME
So for one of your thumbnails, you use something similar to the following URI:
https://storage.googleapis.com/my-project-id.appspot.com/userImages/NT672kMZu5c1kijkAmsoqRUDivC3/profile_120x120.png