I want to create a mobile backend with Google App Engine on Google cloud problem.
I want to develop a Java Servlet that accepts image file and performs some image processing effects (tint,blur, ..) on it.
I'm wondering if there are any libraries that can be used for such a scenario.
Can I use something like OpenCV for example, or I will have to implement the effects functionality from scratch?
Actually, App Engine has a built-in Images API for Java that supports a bunch of different transformations. It may not support everything you're looking for, but it's a low-effort starting point.
Related
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?
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.
Look # Firebase Extensions, there is already such an Extension provided there
What I found is:
The Java, Python, and go Standard environments for Google App Engine
include the GAE Images API (Java, Python, which can resize, rotate,
flip, and crop an image, as well as return an image serving URL which
allows for client side transformations, similar to Cloudinary and
Imgix.
This matches my previous understanding and experience as well. serving_url is really convenient for image manipulations.
Having said that, as you correctly pointed out, it's first and foremost an AppEngine feature and will require you to use AppEngine in one way on another.
If it's not what you want, you can create a service that will crop your images and deploy it serverless. It's a lot less burdensome that having AppEngine service running 24/7. What's more, AWS had several pre-baked templates to do just that - crop images that can be deployed in a couple of clicks.
If you are, like myself, interested in Google Cloud solution I can offer a similar function that I wrote. It can be deployed in Cloud Run as-is. See details in my other answer.
With it you can not only resize the images for mobile, but also map your own domain to the Cloud Run function and put it behind any CDN you like, which potentially can be faster that service from Google Storage. You can find plenty info on the Internet about why full-fledged CND is better than just bare Google Storage.
I am trying Python quickstart project (https://developers.google.com/glass/develop/mirror/quickstart/python) and it is implemented on GAE, however, looking at the code it does not seem that there is much dependency on App Engine itself (code is kind of complicated and I still do not understand it all though).
Is this required to host Mirror-based glassware on App Engine?
Is this required to host Mirror-based glassware on App Engine?
No, it is not required. What you really need is ability to use Google API's and Mirror API is just one of them.
Java quick start, for example does not run on top of GAE.
MySQL has this Sample Sakila DB where we can start playing around with bunch of data already for our application, how about for Google App Engine/GAEJ is there something like this for the datastore?
I started recently to experiment with the Google App Engine and I was confronted with the same question. I was interested in a REST based app engine backbone which I could easily load/unload with data but couldn't find something to play around.
So I started to build up two projects on github which supports me in such kind of work.
clb-appEngineTemplate is a skeleton application for a Google App Engine Jave REST backend. It provides some sample code for a standardized REST API based persistency layer on Business Object level and can be easily extended (using Objectify and GSON).
clb-test which is a utility class which allows to load Test Data from Excel CSV file into your Google App Engine REST backend.
Both projects are maven based and allow me easily to define data objects which I can upload into the App Engine. Mainly I'm run them against the local test server, which serves me for initial testing.
I just released a first version and will incrementally extend over the next weeks.
AFAIK, there is no sample DB for GAE, probably because datastore write operations are expensive. There are demos bundled with GAE SDK. If you are using Eclipse you can import the samples to your workspace. Some of them involve datastore so you can run the application and add data yourself.
Another way is to use bulkloader to upload data at once using CSV files. But you can quickly run out of free quota for datastore writes.
to all
as we all know, Appscript tipicaly for Google Spreadsheet now have a UI builder, though you can compose UI with the script itself the builder is a big factor. now
GAS application is hosted in google drive and can be either share or publish as Webapp. which is great but this type of app is very limited to storing your data in a spreadsheet well, designing a good DB spreadsheet would be enough for small application but is NOT scalable for SME to Enterprise apps.
now having google app engine which have a very good and scalable platform for a webapp.
is there anyway to port the UI library capability and use it for app engine application. having GAS UI as a javascript base (client side) it could be integrated with any serverside language in GAE.
do any one have any example on this or is it now posible?
the way I see it this might be the future for GAE having a GAS as a client side library would be great?
Well, I think you should be looking the other way round. All of Apps Script's UI widgets are borrowed from GWT in GAE. In fact, the Apps Script documentation, at places suggests that we should lookup GWT documentation when this is found inadequate.
Coming to the point of the UI bilder, I'm no GAE expert, but since you get a GWT toolkit for Eclipse, you should be able to use any of Eclipse's UI creating tools ( I may be wrong here).
GWT is compiled to javascript. It doesn't care what the backend is. You can use json to communicate to your python AE instance just fine I would think. I do GWT on java AE so don't have an example of my own but here is an example of using python on AE to use App Scripts https://developers.google.com/apps-script/articles/appengine
Does anyone know if it is possible to read from a Datastore on the app engine to a native app?
I am working my way through making a simple notes app that I can store online and use on my phone and tablet. I would prefer the phone interface be more than just a WebView instance or only used from the browser. I would also like a tablet optimized version as well.
I am comfortable programming android, and I am comfortable with web apps as well, so this is the last important piece before I can start putting it all together.
Has anyone done this before? Or, if it isn't possible, can someone send a link so I can further explore and find out what?
Thanks!
You can interface directly with the datastore using remote_api, but this is designed as an administrative interface, and shouldn't be used for access by end-users. The standard approach for what you're doing - on any webapp, regardless of platform - is to define an API that your application exposes for access to the data, and consume that API from your native app. If you're using Python, you may want to check out ProtoRPC (now included in the SDK) as an easy way to define APIs.