Is Google Cloud Storage fast enough for serving images to mobile apps?

1,020

Solution 1

Look @ Firebase Extensions, there is already such an Extension provided there

Solution 2

The lib use this api. It's in Python 2.7 which have a end of life the 01/01/2020.

Moreover, the image api is available only with AppEngine 1st generation (python 2.7) and not available for the 2nd generation (python 3).

All of this for not recommended you to use this.

The best design today is to perform the resize/crop when the file is uploaded and to store the result in Cloud Storage. Example here and here

Then, you only have to serve, from Cloud Storage, the resized/cropped images.

Share:
1,020
exilonX
Author by

exilonX

Updated on December 15, 2022

Comments

  • exilonX
    exilonX over 1 year

    I have been using Google Cloud Storage to save photos that users upload from a mobile app (built with flutter and firebase), recently I had the need to resize/transform images and I wanted to explore if it's possible to do it directly from google cloud storage!

    I found this project https://github.com/albertcht/python-gcs-image that you have to deploy on google app engine and if you call it with a bucket and an image it returns a URL to a Google CDN I think (something like this http://lh3.googleusercontent.com/*).

    I looked at the code in the repository and the only thing it does is to return the result of google.appengine.api.images.get_serving_url and I don't understand why I cannot get this serving_url directly from my dart code?

    What is the difference between Google Cloud Storage and lh3.googleusercontent.com?? Can I make the same image processing directly from cloud storage?

    It seems odd that I have to run an app engine app that just returns a URL? What am I missing?

    • Chenna Reddy
      Chenna Reddy over 4 years
    • exilonX
      exilonX over 4 years
      I have! But it doesn't answer my question!
    • exilonX
      exilonX over 4 years
      And I am actually using it in my app! The problem is that I don't understand the connection between firebase storage and the link that get_serving_url returns? And also I don't understand why firebase storage is a lot slower than the link to the CDN or whatever get_serving_url returns
    • Chenna Reddy
      Chenna Reddy over 4 years
      Never mind. I misread it. Thought you are looking for options to store images.
  • exilonX
    exilonX over 4 years
    I saw it but it has a lot less features than the link returned by get_serving_url - and as a downside it save different sizes of photos on the storage, which means more costs!
  • exilonX
    exilonX over 4 years
    Thanks a lot for your response! It's kinda sad that you have to save the images on the storage and that implies additional costs