Placeholder images and Gravatar integration with Cloudinary
Most web sites enrich their graphics by embedding pictures and photos of their model entities - users, articles, movies, etc. The graphic design of such web sites assumes that all these entities have associated pictures, otherwise the result will not look as satisfactory as intended. The graphics designer will not like it and the developer having to handle the boundary case of missing images won’t enjoy this either.
<%= cl_image_tag("non_existing_id.png",
:width => 100, :height => 100,
:crop => :thumb, :gravity => :face, :radius => 20,
:default_image => "avatar.png") %>Gravatar Support
You have probably heard of Gravatar., a terrific service that allows you to host a single avatar (profile picture) to be used globally, rather than upload your profile photo on every website that requires it. Any user can sign up to Gravatar with his email address and upload a profile picture. Any website can then access that picture based on an the email address of this user (encoded with MD5 hash for better privacy).
Cloudinary already supports automatically fetching, resizing and delivering Facebook and Twitter profile pictures. We’ve recently added support for Gravatar too. Starting today you can use Cloudinary to fetch your visitors’ Gravatar images, transform these to match your graphics design (non-square pictures, rounded corners, face detection, etc.), use your own default image placeholder for non-existing avatars and enjoy smart caching and fast CDN delivery while automatically refreshing these images when changed.
Embedding Gravatars is done by pointing to a URL like the one below. The 'e3264cf16f34ecd3c7c564f5668cbc1e' string in this example is the MD5 hash for info@cloudinary.com.
.../image/gravatar/e3264cf16f34ecd3c7c564f5668cbc1e.jpg
![]()
With Cloudinary you can of course transform the image to any desired dimension:
.../image/gravatar/w_120,h_80,c_fill/e3264cf16f34ecd3c7c564f5668cbc1e.jpg
![]()
If you use one of our client libraries, this is even simpler. For example, the following Ruby on Rails command embeds a 150x150 Gravatar for info@cloudinary.com:
<%= gravatar_profile_image_tag("info@cloudinary.com", :width => 150, :height => 150) %>
Gravatar supports default images. This allows you to always point to a URL of a Gravatar, based on the user’s email, even if no Gravatar is available for the user. Using Gravatar default images can be done with Cloudinary’s default images support as explained below. Simply specify one of the names of the Gravatar default images as the ‘default_image’ parameter (‘d’ in URLs).
The following example displays Gravatar’s ‘retro’ default image for a given identifier that has no avatar attached:
.../image/gravatar/d_retro/unknown_id.jpg
![]()
Gravatar has a cool feature of displaying a different ‘identicon’ for each user based on the given MD5 hash. The following URLs generate 36x36 thumbnails of two different users, while displaying the ‘identicon’ avatar if no Gravatar is available:
.../image/gravatar/d_identicon,h_36,w_36,c_fill/a9a1a6dafde8cf0c7e8ee9b177160939.jpg
.../image/gravatar/d_identicon,g_center,h_36,w_36,c_fill/e544501b2dd065b385e06a8a8dc7504b.jpg
![]()
With Cloudinary, you can also display custom default images you uploaded to Cloudinary. For example, the following URL delivers a Gravatar for the given email and defaults to the uploaded file named ‘avatar.jpg’:
.../image/gravatar/d_avatar.jpg,g_center,h_36,w_36,c_fill/e544501b2dd065b385e06a8a8dc7504b.jpg
![]()
Default images and Gravatar support are available now for all our free & paid plans. For easier integration with your existing web-dev framework, make sure to download our latest Ruby, Python & Django, PHP, jQuery or the community contributed Perl or .Net libraries.
Adding watermarks to photos is a common practice used to make sure that photos aren't circulated without their owner's authorization and that no one takes undue credit for their creation. Watermarks are common practice at major news outlets and breaking-news blogs. It is also a must for stock photo sites that show you previews of premium images before purchase. Embedding the photographer’s name to photos or crediting a source is also a commonly used practice. 




If you heard of Cloudinary before, you probably already know how useful Cloudinary is with managing all your dynamically uploaded images, transforming these to their required dimensions and delivering them through a fast CDN.
OpinionStage

As web developers, we closely monitor the shifts in today's modern web applications architecture stack. We find the client vs. server-side HTML rendering debate particularly interesting.

When we conceived Cloudinary, our vision was to help websites manage all their assets (images, Javascripts, CSS, etc.) in the cloud, easily and effectively. Our initial focus was on image management in the cloud since we've felt that this particular area was significantly underdeveloped. We figured that every web developer would be happy with a solid solution for image uploads, applying image transformations in the Cloud and getting their website's images delivered through a fast CDN.




