How to get image manipulation url from Google Cloud Storage? - google-cloud-storage

I am trying to have an image server on Google Cloud Storage. Currently I'm using Cloudinary, and I can easily manipulate the image size by passing the parameter within the URL.
How do I achieve this in Google Cloud Storage ?
Thank you,
Wiljon

Google Cloud Storage does not intrinsically support an image resize mechanism. Google AppEngine's Images API (Java, Python, Go) has various serving URL accessors that then take resizing options, but requires the AppEngine application outlive the URL.

Related

Cloud Api Product Search asked for storing the images in the google cloud storage, but can i store them in the firebase storage as alternative?

I'm using the Cloud Api product search, they ask me to store the images and the csv file in the google cloud storage but i'm already using firebase in my project and my images stored there so can i choose firebase than the google cloud ?
Yes, you can use it as an alternative. As Renaud Tarnec commented, Firebase Storage underneath is Google Cloud Storage. This means that any bucket in your Firebase console is actually a regular Google Cloud Storage bucket.
You can confirm this by creating a Storage Bucket in the Firebase console and uploading objects to it (images for your dataset and the CSV file). If you access the Cloud Storage page in the GCP console, the same bucket and objects will be there.
As for using the Vision Product Search API with Firebase Storage, I followed this quickstart guide, but edited the CSV file to point to images that were uploaded to the default Firebase Storage bucket (PROJECT-ID.appspot.com).
After letting the dataset images index, I was then able to send an image to be compared to the dataset as expected.
Keep in mind the service account you use to create a Vision API dataset must be able to read Cloud Storage Objects to access the images in your Firebase Storage bucket. Let me know if this was useful.

how to search text in json file that Google vision api created from pdf

Is there any way to search text in json files that Google vision api created from pdf.
searching of text should be happen over Google cloud storage only
Google Cloud Storage is an Object based storage solution that does not provide processing features. In order to perform any process job over the Cloud Storage data you would need a computing/processing solution, and I’d opt for a serverless option such as Cloud Functions.
I’ve found at the Cloud Functions Docs a sample application that integrates several APIs with Cloud Functions and Cloud Storage, I think you can use it as a guideline to develop your own setup.
Once you have the mentioned setup you could apply a regex implementation to search for the desired data, how to implement it will depend on the runtime, libraries and technologies that you choose to use.

Where to store the downloadable files of the website hosted in Google Compute Engine?

I have design a website where user can upload images and videos. Is it possible the use google cloud storage with compute engine.
Yes, it is possible to use any of google cloud component with each other.
This must be done while creating your instance you need to select the other google component which you want to use with the instance.
In Console while creating new instance, more options you will see
ACCESS Security---Project access and then select which component you want to use with an instance and assign the permission level.
Same will be also possible with gcloud compute while creating instance
I hope this will be helpful.

uploading images to php app on GCE and storing them onto GCS

I have a php app running on several instances of Google Compute Engine (GCE). The app allows users to upload images of various sizes, resizes the images and then stores the resized images (and their thumbnails) in the storage disk and their meta data in the database.
What I've been trying to find is a method for storing the images onto Google Cloud Storage (GCS) through the php app running on GCE instances. A similar question was asked here but no clear answer was given there. Any hints or guidance on the best way for achieving this is highly appreciated.
You have several options, all with pros and cons.
Your first decision is how users upload data to your service. You might choose to have customers upload their initial data to Google Cloud Storage, where your app would then fetch it and transform it, or you could choose to have them upload it directly to your service. Let's assume you choose the second option, and you want users to stream data directly to your service.
Your service then transforms the data into a different size. Great. You now have a new file. If this was video, you might care about streaming the data to Google Cloud Storage as you encode it, but for images, let's assume you want to process the whole thing locally and then store it in GCS afterwards.
Now we have to get a file into GCS. It's a PHP app, and so as you have identified, your main three options are:
Invoke the GCS JSON API through the Google API PHP client.
Invoke either the GCS XML or JSON API via custom code.
Use gsutil.
Using gsutil will be the easiest solution here. On GCE, it automatically picks up appropriate credentials for your service account, and it's got several useful performance optimizations and tuning that a raw use of the API might not do without extra work (for example, multithreaded uploads). Plus it's already installed on your GCE instances.
The upside of the PHP API is that it's in-process and offers more fine-grained, programmatic control. As your logic gets more complicated, you may eventually prefer this approach. Getting it to perform as well as gsutil may take some extra work, though.
This choice is comparable to copying files via SCP with the "scp" command line application or by using the libssh2 library.
tl;dr; Using gsutil is a good idea unless you have a need to handle interactions with GCS more directly.

Using Google App Engine coonfusion

I'm Cococa programmer, but right now I encountered situation when I can't go any further without smarter people:)
I always used small databases in my applciations. I programmed PHP backend on my own server and it worked good.
Right now I have to switch for something much bigger and I decided to try with Google App Engine, because it is relatively cheap and has great scalability.
I'm so confused with documentation and I really don't know where to start.
My new app will store data (images, videos) as well as database (mysql) in google cloud.
I concluded that for app like that I should use:
Google Cloud Storage for images / viedos etc.
Google Cloud SQL for CRUD operations for users (inserting and fetching personal data)
I would prefer to use JSON api. Then I don't have to write any Java, Python or GO code, right? Only REST requests for Google Cloud SQL...
My question is : Am I thinking correctly? Should I use these two services?
Google App Engine has a feature called "Cloud Endpoints" (Java | Python)
that automatically generates a JSON API similar to the APIs that Google provides for its own services (and also generates client libraries in JavaScript, Obj-C, and Java to invoke those APIs), saving you the trouble of writing the REST API yourself and manually serializing/deserializing the request and, instead, focusing on just the business logic that performs the storage and retrieval operations. So, what I would suggest is that you write the code that reads/writes data into the datastore (and cloud storage), but then use Cloud Endpoints to automatically generate your JSON API and client libraries, rather than manually writing that code.
Your plan seems fine so far. Google Cloud Storage is a great choice for storing a large number of images and movies, and Google Cloud SQL is a great choice for handling smaller, more relational data.
If you're using PHP from app engine, there's built-in support for Google Cloud Storage. See https://developers.google.com/appengine/docs/php/googlestorage/
If you're using PHP from your app that lives somewhere else, you could write to the Google Cloud Storage JSON or XML APIs directly, but there's also a PHP library for the Google APIs that might be easier for you to use: https://code.google.com/p/google-api-php-client/