Cpied form : http://cloudinary.com/blog/introducing_a_complete_and_modern_ui_widget_for_cloud_based_image_uploading#face_detection_based_cropped_thumbnail Many websites and mobile applications support user uploaded images and other files. This requires a service to receive and process the uploads, store them safely, manipulate them to match the website or app’s design, and deliver them to your users. This also requires a user interface within your site or app that allows users to easily upload images. At Cloudinary, we have been taking care of the entire image management pipeline from the time our service was launched: from an upload API, to cloud storage via our rich set of image manipulation capabilities, to optimized CDN delivery. Following our customers’ requests, we wanted to create an out-of-the-box complete UI solution that allows image uploading directly from browsers to Cloudinary. This includes UI features, like drag & drop, progress indications, interactive cropping, and preview thumbnails, that are similar to what you can also find in modern web applications, such as Gmail and Facebook, all with a single line of code. And so, we are very excited to introduce Cloudinary's new upload widget.When the widget is open, your users can select a file that will be directly uploaded to your Cloudinary account. Then an identifier (public ID) is assigned to the uploaded image and your web page is updated with the image’s public ID using a callback method. That will make it possible to later reference the uploaded image and generate dynamic manipulation and delivery URLs. For example, below you can see how we have created a 150x150 face detection based thumbnails with rounded corners using an uploaded image’s public ID.documentation page.upload presets.
cl_image_tag("brahghhk8di0ypfrlu7k.jpg", array("radius"=>50, "width"=>150, "height"=>150, "crop"=>"thumb", "gravity"=>"face"))
Mark areas of interest and crop interactivelyOne of our widget's interesting features is the ability to allow your users to perform interactive image cropping while their images are uploaded to the cloud. This can be done by setting the
server. You can try out a live example by clicking on the following button:
gravitymanipulation parameter to
custom. As you can see in the example below, that generates a 200x150 thumbnail of an uploaded image based on the marked coordinates.
cl_image_tag("brahghhk8di0ypfrlu7k.jpg", array("width"=>200, "height"=>150, "crop"=>"thumb", "gravity"=>"custom"))