Is there a way to overwrite existing Blobs in the blobstore - image

I'm using the high performance image serving feature in App Engine to serve up images from the blobstore. However, I'd like users to be able to modify those images (e.g. rotate, crop etc.) and then write those change back to the blobstore, overwriting the original blob. I know I can write to new blobs in the blobstore, as documented here: http://code.google.com/appengine/docs/python/blobstore/overview.html#Writing_Files_to_the_Blobstore
but I don't see a way to overwrite existing blobs. Is this possible in App Engine?
My use case is as follows:
User uploads image, and app engine generates a link via
get_serving_url
The user may then use that link outside of my app, e.g. link to it
on their blog to display the image
If that image is changed later on in my app (rotation, etc.) , I'd
like their image link to reflect those changes

Files stored in blobstore are immutable, once they have been written than can not be changed (only served or deleted).

I think you should try to build your own controller for generate file serving url
- In Datastore each blobFile record have own ID (you manage it) and version ID
- for first upload , set new ID and version
- When user change your image, save new blobstore, keep ID and set new version field
In serving controller generate link by iD, when user call it, get the newest version for serving
It's just my opinion, hope it helpful !

Related

How Should I store images - Codeigniter

I'm contemplating on how to store images in my new site.
Should I save the images directly to the database
OR
should I upload them to my server, while storing the path in my database?
Also, should it be the second choice, how does one retrieve the path of a file he uploaded previously?
You should definitely go with the second option as you can take advantage of the user's browser caching these images after the initial request. It also means your database wont be hit constantly for large files which is always a bad thing.
In CodeIgniter there are various parameters you can use to get the name / full file path to store in the database.
See http://ellislab.com/codeigniter%20/user-guide/libraries/file_uploading.html
Also take a look at this great SO question Storing Images in DB - Yea or Nay?
I tried CI's own libraries , its good but not best, Image moo solved all my problems, uploading, resize, crop etc..
http://www.matmoo.com/digital-dribble/codeigniter/image_moo/

what bits of info are stored in pinterest image urls?

The first bit before the _ is the id of the pin...what are the ZZtfjmGQ used for? I'm assuming the _c is probalby something to do with size.
http://media-cache-lt0.pinterest.com/upload/33284484717557666_HZtfjmFQ_c.jpg
I'm building an image upload service in node.js and was curious what other sites do to store the image.
Final images are served from a CDN, evident by the subdomain in the URL. The first bit, as you pointed out, is the id of the image, the second bit is a UID to get around cache limitations for image versions, and the last bit is image size.
A limitation of CDNs is the inability to process the image after upload. To get around this, my service uploads the files to my Nodejs server where I then serve the image back to the client. I use a jQuery script the user can use to crop the image which sends crop coordinates back to the server and I use ImageMagick to create the various sizes of the the uploaded image. You can obviously eliminate the crop step and just use aspect ratio's to automatically create the needed image sizes. I then upload the final images to the CDN for hosting to end users.
When a user needs to update a photo already in the CDN, the user uploads to nodejs server, images are processed and sized, the UID hash is updated and then uploaded to the CDN. If you want to keep things clean (and cut on CDN cost) you can delete the old "version" at this step as well. However, in my service I give the option to backtrack to an older version if needed.
The rest of the CRUD actions are pretty self explanatory. You can read a list of images available from the CDN using the ID (My service has a user id as well as an image id to allow more robust query operations) and deleting is as simple as identifying the image you want to delete.

Which configuration for "dynamic" images in GWT/GAE (cache, public folder...)?

First, I do not know what I should understand when we talk about "dynamic images"... but in my website (talk about movies - www.mananaseguro.com) I have to display the poster of each movie. So I think these images are considered dynamic images.
I do not know:
If these images should be in the cache, and if yes what expiration date (GAE)?
If these images should be in the public folder (GWT)?
How to correctly refer to these images, I use setUrl("./MananaSeguro/posters/p1.gif") (GWT)?
If my APPLICATION_SPRITE (that have all UI images) be in the cache (GAE)?
I do not like to have all these images in ./client/resources/ directory. Is it possible to have them in the WAR directory to be more conformtable (if yes, how to configure it)?
After that, I will use OBJECTIFY for my database, but the same kind of question occurs :
Do you know in wich directory would I need to store these images (I will need to refer to their path inside the database)?
I do not know GAE, but do you know if there is an interesting feature to store these images (Blobstore)?
Not sure if you're talking about Google memcache service or browser cache. The images should be stored in the browser cache (the required headers will be set by the image service when the images are served). The images should not be stored in the memcache service, that's for storing data that is fetched regularly and/or is expensive to fetch or calculate.
The public (I assume you mean "war"?) folder is for static content, not dynamic. You'd need to re-deploy your application each time a movie was added if you stored movie images here.
The Images service generates serving URLs from blobstore keys. These are the URLs you pass to setUrl on the client.
The application sprite image should go in the public folder as it's static.
This page describes how to specify which files/paths should be served statically from the WAR
The dynamic images will be stored in the blobstore, so you just need to keep the blobstore key to retrieve them
Yes the blobstore is what you're after. With the Images API doing a lot of the "heavy lifting" for you.

Joomla store files in database

I am using Joomla 2.5
I want to store user uploaded content (like images or general files) in the database instead of in the server.
Is there any existing setting which can be used to do this by default?
Note: I am interested in the user uploaded files. Joomla's own files can stay on the server or on in the database, either is fine by me.
The database doesn't store things like images, its stored information. Images and so on are always stored on the server. The only thing you could do is once an image is uploaded to the server, it stored information about it such as the format, dimensions etc in the database. Would be a good idea to use a gallery such as Phoca Gallery or JoomGallery. More can be found here.
If you are looking for a general file uploader then feel free to use my SWFUpload Component which is only for uploading in the admin backend however is a very simple component therefore will be easy to integrate into other components should you need to.

How to let users store multiple size images in cakephp environment?

Im building a mobile app for android & ios using appcelerator. I've build a rest server using cakephp
which returns json.
I would like to know how i could make it possible that users upload a image to a server and the server
resizes this picture to 2 different standard sizes and stores them on the server. This image should be
accessible trough a json get request along side with other corresponding information. My questions are
How can i autimatically resize pictures that are uplouded by users in to two standard sizes and
how can i store these images(in folders or DB) so they are accessible through json alongside their other corresponding infomation?
for the resizing, just google "php resize image". Store the images in some folder in webroot/img folder and store the file name in the db. You might need to rename the file in case there's another file with the same name. When requested, just give the users the url to your image.

Resources