How to resize image before to upload to blostore (resizing from client, but if not possible, doing it from server) - gwt

I am using GWT and the blobstore (GAE). The client uploads an image but I would like to resize this image (w:77px, h:110px) before to store it in the blobstore. I have followed this tutorial :
http://ikaisays.com/2010/09/08/gwt-blobstore-the-new-high-performance-image-serving-api-and-cute-dogs-on-office-chairs/
but it does not do what I want...(moreover, the scaling is done after obtaining the blob key, and I would like to store the image with the good dimentions...).
I will use anything usefull (html 5 file api, gwt upload wrapper, or server side resizing)... but I have no idea how to resize the image coming from a uploader (any code, explication or link to help please).
Thanks you,

Related

In TinyMCE is there a feature to allow pasting images when using the backend image load handler which saves uploaded images on the server?

I'm using the image upload script with a backend URL to rename uploaded images stored on the server. It seems to work well with both file uploads and also drag-and-drop.
Without that backend handling you can paste images directly into the editor, but they get saved as base64 with the post in the db itself which is not great for a lot of reasons.
If I use the image upload script as I am now, it seems it blocks the pasting of images directly into the editor. That's safest, I guess, but I was wondering if there was a way of allowing it, but treating the pasted image like a drag-and-drop image, for example, so we could have the convenience of pasting images but still have them saved with unique filenames on the server instead of being embedded as base64 with the rest of the source of the post?
Thanks.

obscuring / securing filepicker / filestack urls

I use filepicker to serve resized / cropped / watermarked images on a website. I use the regular URL based API to do this: e.g. a url might look like https://.../convert?h=400&w=600&fit=crop&quality=80&format=jpg&cache=true
This obviously allows a lot of flexibility for sizing images on the fly and so on. However, it also means that anyone can get the original un-cropped, un-watermarked image by removing the parameters at the end of the URL.
Is there any way around this short of creating a proxy server that could un-encode an encoded string?
For the latest version, it seems you need to add in your API key to the URL as well - what would stop someone else from using my API key? Are these URLs really meant to be used on a production website in the <img> tags? or for creating a resized image to download, store and ultimately serve up to the end user?
We have updated our processing engine so that it is no longer necessary to pass an API key if you are transforming an image based on its Filestack Handle:
https://process.filestackapi.com/watermark=file:ZoVdwbe6Qcu9uIxIZSuU/h2T4Jl9RBSSXOGtl0gv8
However, a user could still get the image without the watermark. So, we also have a store method built into the processing engine:
Posting the image with our store task attached:
curl -X POST -g "https://process.filestackapi.com/store/watermark=file:ZoVdwbe6Qcu9uIxIZSuU/h2T4Jl9RBSSXOGtl0gv8"
Will return the following:
{"filename":"photo-1435771112039-1e5b2bcad966.jpg","height":750,"size":67588,"type":"image/jpeg","url":"https://cdn.filestackcontent.com/62aWdbPvQzWNrl90C7q9","width":1000}
Which is a saved version of the watermarked image, so the watermark cannot be removed:
https://cdn.filestackcontent.com/62aWdbPvQzWNrl90C7q9
We recommend using the newer method but you should also set up security so that people can't hotlinking to your content.
https://www.filepicker.com/docs/security/
I would also recommend move over to Filestack as it we have rebuilt all the infrastructure.

Have a static url to host a picture that i will update monthly (iPhone app)

Okay so I want to load a image from a URL in my app, however this image will need to be updated every month manually, therefore its not practical to have to submit a new update to apple every time the url changes. So does anyone no of a picture/file sharing site that would allow me keep the same URL for the image even when uploading a updated version of the image?
You can just use the same url for the image that you want presented hosted on your domain or a hosting site.
So something like
http://www.mydomain.com/appImage.jpg
That you always call to and always is the address of the relevant image. Basically the URL is just a location that you can store any image at.
Up to my knowledge, in order to achieve this you will need a static URL. So that means you'll have to buy a domain from a hosting service.
Or if not you can use Google Drive for this. But you'll have to do some more coding for this.
Try using Google Drive:
Upload a text file(*.txt) to your Google Drive and get a shareable link. Convert it to a direct download link.
Next save whatever your image as a String (base64); I have attached some interesting coding examples below.
Then give the file link to your app; download the file; read the String(base64) convert it back to image format.
When you want to update the Image convert it to a String; open the Google Drive; edit your file using Drive Notepad (Do not use
Google Docs) and simply save it Ctrl+S.
Useful Links:
Google Drive Direct Link Generator
Convert between UIImage and Base64 string
Converting between Image and Base64 string in iOS
Java BufferedImage to PNG format Base64 String
Convert image to base64 with java
Hope this helps.

filepicker the front end cropper

To make it even easier to work with user content, we enable image post-processing. This way, regardless of what type of file a user uploads from the Cloud or their local device, you can be sure it's in exactly the right size. To convert an image, take the filepicker url and append /convert, along with query parameters specifying what you want to change. See the DocsĀ»
filepicker.io shows an example of a cropping tool on their front page. Could that be built into the picker itself?
We've discussed building it into the upload experience a la iOS, but think that the functionality is best done as a step after the upload. The demo on our front page is done using JCrop, and at some point we'll open-source the demo as a jquery plugin or similar.

Uploading an Image object with GWT

So this is what i want to do.
I have an Image object ( http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/Image.html ) and i want that uploaded to the Blobstore.
So this is my problem.
The formpanel i'm trying to use only works when the user actually supplies a file directory, so there is no way i can give an image adress to the form to upload like this:
blob:http://127.0.0.1:8888/6276f066-d415-45f4-984b-e0f98c542c50
So my question is:
How would i be able to upload an image from such a source to the blobstore.
Is it even possible?
Any and all help is much appreciated.
Gwt's Image represents and <image> tag, which in turn represents an image loaded from server.
AFAIK, there is no way for javascript (and GWT) to get the data from <image> or Image, so consequentially it can not be uploaded.
Since the data for Image comes from server, why do you need to upload it back to server? If you are doing some selections, couldn't you just get the URL of the image and sent that to server?