Cloudinary Blog
Learn More

Webhooks, upload notifications and background image processing

May 21, 2013 by Tal Lev-Ami
Web applications and web APIs are usually programmed to perform requests in a synchronous manner. A common web-based access flow will start with a requester accessing a remote service. The remote service in turn will process the request and quickly return the result. 
 
But sometimes a web application will need to perform actions asynchronously in the background. 
 
Consider, for example, a computing intensive web request. Such a request might take a very long time to finish. UI wise, you might not want your users to actively wait so long for this command to finish. Technically, such a long running HTTP request might even time-out completely. 
 
In this case, you will probably want to employ a different access flow. In this flow, when the requester accesses the remote service, the remote service will return immediately with a 'pending' result. The remote service will then continue to perform the action in the background. Finally, when the remote service is finished, it will notify the requester that the required action was completed. 
 
The same concepts apply to Cloudinary's image management APIs. 
 
So far, Cloudinarys APIs were synchronous. For example, if you wanted an image transformed, you would have to wait synchronously until the transformation was finished.
 
In this blog post we wanted to introduce Cloudinary's new notifications and background processing capabilities that further extend the image management solution available when using Cloudinary.
 

Webhooks and upload notifications

Many mobile and web applications upload images and files to Cloudinary. Such uploading can be performed either from these services' backend or directly from their users' browsers or mobile applications. In such cases you might want to make sure your server is notified when an upload is completed. 
 
You can do that by setting the notification_url parameter of Cloudinary's upload API to any valid HTTP (or HTTPS) public URL.
 
For example, in PHP:
$result = \Cloudinary\Uploader::upload("sample.jpg", 
   array("notification_url" => "http://mysite/my_notification_endpoint"));
When the upload is completed, an HTTP POST request will be sent to the notification URL you provided. The post data will contain all upload result details as returned by our upload API (public ID, URLs, image dimensions, semantic data if requested and more). The request will also contain a signature of the sent data so you can verify the sender.
 
Here's a sample POST request with a JSON of the upload result:
POST /my_notification_endpoint HTTP/1.1
X-Cld-Timestamp: 1368881627
X-Cld-Signature: 29a383e289bc569310a8ca9899019a3167b4909e
Content-Type: application/json

{"public_id":"djhoeaqcynvogt9xzbn9","version":1368881626,"width":864,"height":576,"format":"jpg","resource_type":"image","created_at":"2013-05-18T12:53:46Z","bytes":120253,"type":"upload","url":"http://res.cloudinary.com/1233456ab/image/upload/v1368881626/djhoeaqcynvogt9xzbn9.jpg","secure_url":"https://cloudinary-a.akamaihd.net/1233456ab/image/upload/v1368881626/djhoeaqcynvogt9xzbn9.jpg"}
By the way, you can use RequestBin to test notifications received during development.
 
The signature is calculated as follows:     
SHA1-Hex-Digest("{data}{timestamp}{api_secret}")
Your server application can use this notification to update your model and database regarding the uploaded images or to cleanup unused uploaded files.
 
Here's another example in Ruby on Rails for generating a file input field that performs direct uploading from the browser using a jQuery plugin.
<%= cl_image_upload_tag(:picture, 
      :notification_url => "http://mysite/my_notification_endpoint") %>

Eager transformations in the background

By default, when you access Cloudinary delivery URLs, transformed images are generated dynamically if they don't already exist, according to the transformation parameters. You can also use Cloudinary's eager transformations, in which case multiple transformed versions of an image are created eagerly while uploading so they are ready for fast delivery even for the first download request.
 
Sometimes, you might need to create a single time consuming transformation or many eager transformations of an uploaded image. Creating such transformations might take seconds, especially if the original image is very large. In such cases, you probably don't want your user to wait for the process to complete. 
 
Using Cloudinary's asynchronous eager transformations, you can now define multiple eager transformations while uploading. The upload request will return immediately, the transformations will be performed in the background by Cloudinary and you will get notified (if you want) when the transformations are ready.
 
You can enable asynchronous eager transformations by setting the new eager_async upload API parameter to true. In addition, you can set the optional eager_notification_url to receive an HTTP POST request when the transformation generation is completed.
 
The following example in Python (or Django) creates multiple transformations eagerly in the background.
cloudinary.uploader.upload("sample.jpg", 
   eager=[dict(crop="fill", width="150", height="100"), 
          dict(effect="sepia", width="0.5", crop="scale")], 
   eager_async=True, eager_notification_url="http://mysite/my_notification_endpoint")
Here's an example of how the notification post request might look like:
POST /my_notification_endpoint HTTP/1.1
X-Cld-Timestamp: 1368883736
X-Cld-Signature: 09ef8c16f6e0ff85f5345d4813973de8f746448d
Content-Type: application/json

{"batch_id":"c0ed79e610f0636d15a1353a0a866933","notification_type":"eager","eager":[{"width":150,"height":100,"url":"http://res.cloudinary.com/1233456ab/image/upload/c_fill,h_100,w_150/v1368883730/noapoaq60varndxnh2or.jpg","secure_url":"https://cloudinary-a.akamaihd.net/1233456ab/image/upload/c_fill,h_100,w_150/v1368883730/noapoaq60varndxnh2or.jpg"},{"width":432,"height":288,"url":"http://res.cloudinary.com/1233456ab/image/upload/c_scale,e_sepia,w_0.5/v1368883730/noapoaq60varndxnh2or.jpg","secure_url":"https://cloudinary-a.akamaihd.net/1233456ab/image/upload/c_scale,e_sepia,w_0.5/v1368883730/noapoaq60varndxnh2or.jpg"}]}


Background sprites, animated GIFs and PDFs handling 

Cloudinary supports generating sprites: merging multiple images into a single large image for a more efficient browser loading using a generated dynamic CSS. 
 
Sometimes you might want to merge tens or even hundreds of images into a single sprite. 
 
Cloudinary's image manipulation are fast and efficient, but transforming and merging so many images might take more that your API client request can wait. In this case an HTTP request timeout might occur.
 
You can now tell Cloudinary to perform such sprite generations in the background by setting the async API parameter to true. In addition, you can set the notification_url parameter for receiving a webhook request when the process is completed (as explained above).
 
The following Ruby example requests for a sprite generation to be performed in the background:
Cloudinary::Uploader.generate_sprite("faces", :width => 150, :height => 100, 
   :crop => :fill, :async => true, 
   :notification_url => "http://mysite/my_notification_endpoint")
 => {"status"=>"processing", "batch_id"=>"163a919cde8f9317d6ee0fbfe6375dc4"} 
The API returns immediately with the response below while the later notification will include the final generated sprite details:
POST /my_notification_endpoint HTTP/1.1
X-Cld-Timestamp: 1368882586
X-Cld-Signature: d91bccba5f1bb38905fc6a9284914e8959fb4a7b
Content-Type: application/json

{"batch_id":"f97c6bf03074d9641f1a9c9b6bcebef7","css_url":"http://res.cloudinary.com/1233456ab/image/sprite/c_fill,h_100,w_150/v1368882583/faces.css","image_url":"http://res.cloudinary.com/1233456ab/image/sprite/c_fill,h_100,w_150/v1368882583/faces.png","secure_css_url":"https://cloudinary-a.akamaihd.net/1233456ab/image/sprite/c_fill,h_100,w_150/v1368882583/faces.css","json_url":"http://res.cloudinary.com/1233456ab/image/sprite/c_fill,h_100,w_150/v1368882583/faces.json","version":1368882583,"image_infos":{"face_center_eer8ss":{"width":150,"height":100,"x":0,"y":0},"face_left_b7ikxf":{"width":150,"height":100,"x":152,"y":0},"face_top_usjwvk":{"width":150,"height":100,"x":0,"y":102},"front_face_cywiib":{"width":150,"height":100,"x":152,"y":102}},"notification_type":"sprite"}
You can now create an animated GIF or a multi-page PDF document in a similar fashion. 
 
You can also "explode" a PDF in the background into multiple separated images representing all of its pages. All this is done using Cloudinary's 'multi' and 'explode' methods by setting the async parameter to true and optionally setting a notification_url. Here are some examples in Ruby:
Cloudinary::Uploader.multi("faces", :format => 'gif', :width => 150, :height => 100, 
   :crop => :scale, :async => true, 
   :notification_url => "http://mysite/my_notification_endpoint")
Cloudinary::Uploader.explode("multi_page_pdf", :format => 'png', :width => 200, 
   :height => 300, :crop => :scale, :page => :all, :async => true, 
   :notification_url => "http://mysite/my_notification_endpoint")

Summary 

As always, our goal with Cloudinary is to solve all of your web and mobile app's image management and image manipulation aspects for you and let you focus on your core business logic.
 
As a developer, you are probably familiar with the complexities involved in managing background processing and push notifications yourself. We believe that Cloudinary’s new webhooks and the ability to perform computing intensive image manipulations asynchronously in the background will prove as very useful tools in your image management tool-belt.
 
We're anxious to hear your feedback about these new features. Make sure you drop us a line in the comment thread below!
 

How Mediavine handled image load in a 50M+ page-views Rails site

May 01, 2013 by Itai Lahan
 
We are often asked to share our customer stories with the rest of the Cloudinary community. Whether it's for learning about others experiences managing images with Cloudinary, or just to reaffirm Cloudinary's solution - we love to hear your stories and we're happy to share them.
 
Today, we wanted to introduce you to Mediavine Inc., one of the largest online entertainment networks on the web, and how they utilized Cloudinary to solve their image management needs.
 
 

The customer

Mediavine, Inc. owns and operates some of the web's largest entertainment and lifestyle properties. Mediavine's network of sites include:

       TV Fanatic

     
        Movie Fanatic
         
       Food Fanatic
         

 
 
 
 
 
 
 
 
 
Combined, these websites garner a traffic of nearly 50 million page views a month. 
As modern media outlets go, Mediavine's websites are incredibly image rich. 
 

The challenge

Mediavine's sites run on a custom Ruby on Rails CMS hosted on Heroku. Like many other Rails sites, they started off using the Carrierwave and mini_magick gems to handle their image needs. 
 
However, as their page views and image processing needs grew, they quickly ran into performance problems
 
"No matter how much we optimized image uploads - including moving all version processing to background workers - uploading several high resolution files was just not going to be possible through the dyno manifold." Says Eric Hochberger, founder and head of development at Mediavine. "We knew we needed to go directly to our image store, S3. We looked into rolling out our own solutions, such as carrierwave_direct, but they were far too complex after way too many hours of struggling. And they would still require additional image processing!"
 
 
 

The solution

We asked Eric if he could share his experience with Cloudinary: 
 
"With Cloudinary we got direct upload to the cloud working within minutes. But it didn't just stop there. Cloudinary solved our timeout issue, while greatly speeding up our uploading process, thanks to its easy-to-implement javascript upload." Eric said.
 
"Cloudinary did more than that though. It helped us solve problems we had previously never thought were fixable," Eric added. "Scaling animated gifs worked perfectly without any of our previous imagemagick glitches. As for face detection we thought only the geniuses at Facebook could possess?  Yeah. We have it now. Full ITPC data?  Just try getting that out of mini_magick. Now we can pull locations out of images."
 
What about the integration with Cloudinary? "This all came in ridiculously easy fashion. Really, when it comes to any headaches with dealing with images, Cloudinary has solved them all. Its URLs even solve CDN cache busting. Working with Cloudinary's gem and carrierwave implementation has been a programmer's dream."
 

Recommendation

"It's rare when you can outsource a problem and save money but somehow Cloudinary managed to do that." says Eric. "We were able to knock our direct image hosting costs in half from S3/CloudFront, thanks to Cloudinary's generous pricing and optimization. Even better, we were able to significantly reduce Heroku usage, courtesy of seriously reducing worker dynos with outsourcing thumbnail and version generation. Talk about a win-win."
 
"Even if you have a 'working' solution," continues Eric, "we promise Cloudinary will do it better. Don't worry if you have to migrate from an existing system. They even come with code to help you do that. We had our hundreds of thousands of images migrated in less than an hour. And thanks to the fact they support carrierwave, we had minimal code changes."
 
 

Final words

We were very impressed by just how fast Mediavine managed to wrap their heads around the Cloudinary service, migrate their images and complete the full integration. 
 
We are extremely excited to have Mediavine using Cloudinary, and wanted to thank Eric for taking the time and sharing his experience.
 
Cloudinary users - let us know if you want to share your own unique experience using Cloudinary. We'd love to feature your services here and we're sure that all of Cloudinary's customers will find your insights helpful.
 

A story about production systems, Rails, monitoring and off-hour notifications

Apr 25, 2013 by Nadav Soferman
Cloudinary's image management service is used by thousands of world-wide websites and mobile apps. For many of our clients, Cloudinary has become a central, mission-critical component used for managing image uploads, transformations and delivery.
 
This is why we've built Cloudinary from the ground up to be a very robust service. We put a lot of emphasis on availability, scalability and support and we take our users' confidence in us extremely seriously.
 
So far, we've been quite satisfied with our ability to keep Cloudinary at an average of > 99.99% uptime.
 
However, on April 4th, the Cloudinary service experienced outages for a few hours. We wanted to explain what happened, our conclusions and the steps we've taken to make sure this won’t happen again.
 

The upgrade

Cloudinary's core service is built with Ruby on Rails. The service is tested thoroughly and upgrades are handled with uttermost care. This is why we've preferred to stay with Rails v3.0 for a long time rather than rock the boat with an upgrade to the latest Rails 3.2.
 
A few weeks ago a security vulnerability was discovered in Rails. As always, we wanted to apply the security fix as soon as possible. However, the Rails team stopped releasing fixes for Rails 3.0. We had to upgrade to v3.2.
 
We've upgraded to Rails 3.2 in our lab and modified our code to support it (Rails upgrades tend to be non backward compatible and break code built with previous versions). We've tested our code extensively and verified that our thousands of unit tests passed correctly. We've successfully finished a thorough manual QA of the system in our staging environment. It all went quite smoothly.
 
We scheduled the upgrade for April 4th. As usual, we deployed the system gradually to all of our production servers. Deployment went smoothly as well. We performed additional sanity testing after the system was deployed and closely monitored the system during the working day.
 
We went to sleep happy and relaxed.
 

The issues

At about 1am at night things started to shake.
 
Apparently, Rails 3.2 changed the defaults of one simple configuration parameter - response caching was turned on by default when certain cache headers are returned.
 
As a result, after long hours of service requests, the local application disk for some of our servers became full due to the cached responses. This caused certain requests that required disk space to fail, depending on the exact request and the size of the response.
 
Annoyingly enough, the automatic monitoring service that regularly verifies our APIs, was performing a request that required very little disk space and continued to operate regularly. This service is configured to send notifications to our engineering team's mobile phones during the night. But since no errors were detected, no notification was sent.
 
Fortunately for us, our co-founder's toddler woke him up early in the morning. He naturally (?) checked his inbox, understood that something was very wrong. He quickly cleared the disk space and modified Rails 3.2 cache settings. The system was fully working again.
 
It's important to note that during these ~5 hours, all existing images and transformed images were delivered successfully to users through our delivery service and tens of thousands of worldwide CDN edges (Akamai + CloudFront). Still, part of the upload API calls did fail during this time and we are very sorry for this.
 

Going forward

Naturally, we've immediately started to improve our outage prevention mechanisms.
 
We've added additional disk space tests to our QA list and added abnormal disk usage monitoring to our urgent notification service. We're also adding a wider set of API requests to our automatic service monitoring.
 
We've integrated with Twilio to enhance our off-hour notifications. Specifically, our engineering team will now receive automatic voice calls to their mobile phones in addition to our previous notification methods.
 
To make sure we keep you in the know during outages, we've pushed up the priority of a public status page. This page will include automatic monitoring details as well as human written notes.
 

Summary & conclusions 

We are happy that Cloudinary had nearly zero availability issues in almost 2 years of operations. On the other hand, no online service is perfect and every service experienced or will experience outages. 
 
We will continue to enhance our service with additional image-related features. On the same time, we'll continue to work hard on having Cloudinary's uptime as close to 100% as possible.
 
Thank you for trusting us with your images!

Windows Azure add-on for cloud-based image management

Apr 23, 2013 by Nadav Soferman
Call us prejudice, but as a hardcore Linux guys, the name Microsoft always caused us to flinch a little. That was our initial reaction when we were approached by the Azure team. We have been integrating Cloudinary with many PaaS providers to make our platform as accessible as possible, and Azure actually made perfect sense. Still, we were a bit hesitant at first as we never considered Microsoft a leading player in the world of rapid web & mobile development. 
 
As you may have figured out, we were very impressed by Microsoft's Windows Azure cloud platform and the great team behind it. The Windows Azure platform boasts powerful built-in support for modern development frameworks popular among both enterprises and small startup companies. You can deploy your web and mobile applications in Azure's class using PHP, Python & Django, Node.js, Java and of course .NET.
 
 
 
 
With this in mind - we are very excited to announce Cloudinary's add-on for the Windows Azure cloud platform.
 

What does Windows Azure offer? 

Azure is a PaaS that offers cloud-based deployment and hosting for your web-based applications. Azure also offers virtual machines for running your apps, a hosted & managed SQL database, cloud-based storage and more. All of this is smoothly integrated with visual studio and can be managed via a powerful web interface.
 
Last but not least, the Windows Azure Store offers plenty of add-ons to enhance your applications.
 

What do we get when using Cloudinary as an Azure Add-on?

Cloudinary's Azure add-on allows you to easily upload your web application images to the cloud. Your images are stored on a safe and highlighly available location with automatic backups and historical revisions.
 
Once on Cloudinary, you can manipulate and transform your images in the cloud to match your graphic design: resize, crop, alter shape, apply effects, add watermarks and more without installing any software on your side. All your images are automatically optimized and delivered to your website visitors through a fast, world-wide CDN with advanced content caching.
 
Cloudinary is easy to integrate with and offers open-source client integration libraries for your PHP, Python & Django, Node.js, Java and .NET applications.
 
You can register to your Cloudinary account from within the Azure portal using just a few clicks. Registration and integration is free and you can upgrade to a paid plan once your application gains traction and requires larger resource quotas.
 
 
 
 
If you want to see how easy to use and how powerful Cloudinary is, check out this integration guide
 
So whether you are a Microsoft fan or just looking for a great cloud service provider, you should take time to check out Windows Azure. Once there, if you need a cloud-based solution for image uploading, storage, manipulation, optimization and delivery, make sure you add Cloudinary to your list of add-ons.
 

10 Startup companies that manage their images in the cloud - Part 2

Apr 10, 2013 by Orly Bogler
As Cloudinary continues to grow, the number of companies using Cloudinary to manage their images grows with us. Each company has its own unique product and utilizes Cloudinary in a different, fascinating way. In this post, we wanted to introduce you to several cool startup companies, and with them, the many different ways that Cloudinary’s services can be used. 
 
In the spirit of making a tradition out of it, we present Cloudinary's "10 Startup companies that manage their images in the cloud" - Part 2. (click here for Part 1).
 
 
 
JustGo Music is a social music newspaper and content syndication platform launched in the fast growing electronic dance music industry for fans and pros alike. JustGo Music's media rich website leverages Cloudinary for embedding Facebook profile pictures of your favorite artists.
 
 
Tint helps you build web pages made up of all your social website images, feeds and hashtags. All the images shown in Tintup's widgets are fetched by Cloudinary from every available social network. Cloudinary then optimizes and deliver the images to Tintup's viewers.
 
 
Milkster is a crowd-curated catalog of remarkable lifestyle products from around the world and across the web. Milkster utilizes Cloudinary to upload, manipulate and deliver all of these great images.
 
 
Givey 
Givey is a Social Donation Platform that makes giving to the causes you care about effortless. 
Givey makes sharing, caring and charity in general, easy by connecting people that care about similar causes and allowing to donate to those charities.
 
 
Apartable provides personalized apartment matching and recommendations to renters, suggesting relevant apartments and giving them all the information they need to make an informed decision. All the apartment images, there to give you a better idea of what you're heading in to, are managed by Cloudinary. 
 
 
SunnyBump helps new parents discover, curate, share, & buy the best baby products on the market today. With the help of parents who've been there before and the industry experts who know, SunnyBump helps find all the baby products around. 
 
 
Tunezy 
Tunezy is a social platform for the recorded music industry, which creates a platform where fans and musicians can build experiences together. Tunezy utilizes Cloudinary to streamline their image management needs. 
 
 
Toogethr  
Toogethr is an online and mobile transportation service that lets you make best use of social networks. Toogethr's mission is to make mobility affordable, sustainable and social, by optimizing the billions of empty car seats in this world, and building a door-to-door rideshare network.
 
 
Not a startup per-se, SeeYourImpact is a non-for-profit that offers a revolutionary method to help those in need by a way of gift giving. These gifts will go on to change people's lives. Following the donation, a photo and story is sent over to the gift donor showing his impact on the world. The photo, and all other images on site, are delivered via Cloudinary. 
 
 
Roomz 
Roomz goal, as its name implies, is to help find the best roommate for you. A roommate that loves your flat, furniture, dog, cat and goldfish. Roomz is a platform to connect people looking to share cold pasta and cheesy 80's movies in a great apartment. Cloudinary is here to deliver all the images involved, so you'll know exactly where you're headed, what bedroom you're going get and how your potential roommate looks like first thing in the morning.
 
 
As you can imagine, it was difficult to choose only 10 companies, but we tried to keep the fields of interest varied and to show as many different integration methods with Cloudinary. We hope to continue with this tradition, so if you're not on this list and would like to be - drop us a line! We would be happy to include you in the next one, and to thank you for using our services of course. 
 

Automatic image sharpening and blurring in the cloud

Mar 20, 2013 by Nadav Soferman
Images. Your web (or mobile) application is probably filled to the brim with images. You might be surprised at just how much impact these images have on your visitors. From their graphical appeal to their size and access times - these images determine your visitors browsing experience and ultimately their conversion to repeating visitors and paying clients.
 
Now, while your graphic designer has created a cool graphical concept, many of the images you need to embed inside it are not in your direct control. Social websites contain profile photos uploaded by their users. E-commerce solutions contain many product photos that can't be edited one at a time. Media outlets contain many photographs of different consistency.
 
Having a tool in your belt that offers automatic tweaks and retouches for all these images is quite handy. Here a couple of things you can do with Cloudinary that can really improve your website.

Image sharpening

How can you make your website "pop"? it's easy if you control the exact content across your web application - a great graphics design can make wonders. But what can we do to improve user uploaded images? 
 
Let's look look at the following image uploaded to Cloudinary:
  
 
The photo looks good. But just take a look at what a bit of sharpness can do to it. 
You can add sharpness by setting the effect transformation parameter to sharpen (or e_sharpen for URLs):
 
 
 
Here's the same example in Rails:
<%= cl_image_tag("front_face.jpg", :effect => "sharpen") %>
You can control the strength of the sharpen effect to match your taste. Here's a more intense sharpening of the same image by setting the sharpen level to 300. Quite a nice photographic effect.
 
 

 
Same example in PHP:
<?php echo cl_image_tag("front_face.jpg", array("effect" => "sharpen:300")) ?>
Sharpening is also useful in making text elements in thumbnails clearer. For example, the following screenshot was uploaded to Cloudinary. As you can see the small gray text snippets are not so clear here.
 
 
 
 
Sharpening such an screenshot would make the text more readable. The following example sharpened this image. This time using the unsharp_mask effect that is similar to sharpen but uses a different algorithm. Much more readable:
 
 
 
 
Same example in Django:
img = cloudinary.CloudinaryImage("front_face.jpg")
img.image(effect="unsharp_mask")

Image blurring

Image sharpening is useful for improving images and making them "pop". But sometimes you would want to aim for the opposite effect. Quora, for example, is using dynamically created blurred snippets of text if you're browsing an answer while being logged out. How can you do that using Cloudinary?
 
To blur images, you can use Cloudinary's blur effect (e_blur for URLs). Here's an example: 
 
 
 
 
You can also make the blurring more intense by passing a numeric level. The following example applies the blur effect with a 400 intensity on the sample image:
 
 
 
In the following example, we blurred the image intensely and also reduced its opacity. Then we added a text overlay that calls users to sign up to your site if they want to view the full content:
 
 
 
Sample example in Rails:
<%= cl_image_tag("front_face.jpg", 
                 :overlay => "text:bold_dark:Sign up to see more",
                 :gravity => :center,  
                 :transformation => {:effect => "blur:500", :opacity => 50}) %>
Sometimes you want to blur only a certain region of an image. You can use the blur_region effect together with exact coordinates specified by x, y, width and height parameters. Here's an example that blurs only part of an uploaded screenshot:
 
 
 
Same example in Node.js:
cloudinary.image("front_face.jpg", { effect: "blur_region", x: 0, y: 0.5, w: 1.0 });
You can also automatically blur all faces detected in an image using Cloudinary's blur_faces. In the following example the face was automatically detected and blurred using the default level:
 
 
 
Same example in .NET:
string url = cloudinary.Api.UrlImgUp.Transform(
  new CloudinaryDotNet.Transformation().Effect("blur_faces")).BuildUrl("front_face.jpg");


Summary

Automatic image sharpening and blurring can do wonders to a website. For static assets, you can do that manually using your favorite image manipulation software. With Cloudinary such effects can be automatically applied to millions of user-uploaded images with ease. And if you decide to spruce up the graphical effects in your site's images, you can simply modify the transformation parameters in your development framework of choice. All images will be regenerated on the fly using the updated effect and will be served to your users optimized through a fast CDN.
 
It would be great if you try out the new filters and tell us when you think. If you don't have a Cloudinary account yet, you can create one for free.
 

Cloud-based media library management for Web and mobile applications

Mar 12, 2013 by Nadav Soferman
Can your users upload their own images to your web or mobile application? What about your content partners - do they upload their images directly to your service? 
 
We frequently hear complaints that as the service owner, you don't get enough visibility into the images uploaded to your service. In this blog post, we wanted to help you change that.
 
At Cloudinary, we aim at covering all image-related tasks required when developing websites and mobile applications. Specifically, Cloudinary offers an end-to-end solution to your main image management pipeline - image uploads, storage, manipulation, and delivery. 
 
In the past year, we've put a lot of emphasis on enhancing Cloudinary's APIs with a thorough set of manipulations, transformations and effects capabilities. Lately, we've been buffing up the online media management capabilities of Cloudinary.
 

Your online media Library 

Once images are uploaded to Cloudinary, they are first provided with a safe and secure online storage location. Once there, we tried to offer a better visibility and better manageability to your website’s growing online media library.
 
In this blog post we wanted to introduce you to Cloudinary's new cloud-based Media Library and image transformations management UI. Some highlights:
  • Easily browse through all of your websites images. 
  • View detailed image information.
  • Manually upload multiple local or remote files.
  • Assign tags to images and select images to be deleted.
  • Interactively apply any desired image transformation.
  • Define powerful cloud-based image transformations and name them for future reuse.
 

Media library browsing 

If you ever visited Cloudinary's dashboard, you probably saw the overall statistics views - total number of images, derived images and transformations, storage and bandwidth usage charts, etc.
 
 
Now you can also easily navigate through all of your images, view automatically generated thumbnails, search images by their name (public ID) or assigned tags. 
 
 

Manual image uploading 

You can use our new cloud-based media library for manually uploading images. You can drag & drop or select multiple files. 
 
 
Our advanced uploading menu also allows you to define custom public IDs for uploaded images, assign one or more tags for later referencing them by and perform uploading from a remote HTTP URL instead of from your desktop machine.
 
 
 
By the way - this uploading interface was implemented using Cloudinary's jQuery plugin.  You too can use our jQuery plugin in your web application to create a great looking image upload form that allows direct uploading from the browser to Cloudinary, support drag & drop, multiple images uploading, progress indications and more.
 

Visual transformation generation

Clicking on an image will get you to our new visual transformation page. From here, you can interactively apply any desired cloud-based image manipulation supported by Cloudinary: resize, crop, detect faces, round corners, rotate, apply effects, modify opacity, add border, add a watermark and more. An easy to use visual interface lets you generate Cloudinary's CDN-based transformation URLs and see a live preview of the result.
 
  

Transformation management

With our new Transformations console, you can browse through all the transformations dynamically generated by your website or mobile application. Click a transformation to view a live sample preview and apply further fine tuning.
 
 
 
You can also use the new user interface to apply any advanced transformation options supported by Cloudinary. You can chain multiple transformations together to reach more complex results and add one or more overlays and underlays. After you’ve finished designing the transformation that best matches your graphics design requirements, you can assign it with a short name for easily re-using it in your web and mobile applications.
 
 

Summary

We are very excited about the new media library and transformation management UI. We hope you like it too and find it a useful tool for easily managing your website’s cloud-based images. 
 
As always, we have many future plans down the road for our cloud-based media library management - view powerful insights and reports, seamless CMS integration, code sample generation, pre-defined set of useful transformations, and more. Stay tuned for updates.
 
As always, we would appreciate any feedback or comment you have regarding the new media library. Try it out and tell us what you think? If you don't have a Cloudinary account yet, click here to create a free account.

Announcing new support portal, knowledge base and community forums

Feb 20, 2013 by Orly Bogler
Tags: General, Support
Since its inception, one of Cloudinary's main pillars was to always be there for our customers. Every question you ever asked us helped us better understand what image solutions are most important to you. Every support request helped us find and fix gaps in our product and our documentation. Nearly every feature request we got was immediately given top priority and helped us shape Cloudinary into the service it is today. Without a doubt, we owe much of Cloudinary's success today to the amount of open communication we have going with our community.
 
We are extremely excited to see how fast our customer base extends and have decided to make it a priority to upgrade our support infrastructure as soon as possible. In addition to quick response, we wanted to offer a new, simpler ways of extending Cloudinary's combined knowledge base, offering a place where our community can quickly find answers to burning questions, a location where you can share your Cloudinary experience and best practices for the whole community to enjoy.
 
Without further ado, we're happy to announce our newest addition to Cloudinary - our new support portal.
 

The Knowledge Base

While brand new, we hope that our knowledge base will grow to give answers to many of your most urgent questions. Our knowledge base is detailed and broken down into topics, for easy browsing. There is also a quick search option to simplify the browsing even further. The knowledge base should cover anything from image uploading and transformations, client libraries and how to integrate with them, plans, billing and security to name a few. 
 
So far, we have done our best to punch in all the questions and answers that we have seen come up often, with easy to use solutions and explanations. These Q&A's always have room for improvement. For each question and answer there is an option to comment, ask a follow up question or clarification. 
 
 

Support Tickets  

If you can't find your answer in our knowledge base, just contact our support team. For any technical issues and queries you run into, large or small, we'll do our best to offer a quick advice. 
 
With our new ticketing system, you can insert all the details of your query and have a way to track it. You will be able to know at every moment what its status is, what team member is helping you and more. This will allow closer monitoring and promise faster responses and results.
 
 

Email & Chat Support 

Don't like forms? Just email us at support@cloudinary.com, it reaches the same ticketing system, only without the dropdown & fill-in form.
 
Do you prefer a more personal question & answer session? Just click the small Contact Us button at the bottom-right of your cloudinary.com browser window. If we're there, we'll be happy to chat, and if not - just leave a message and we'll get back to you asap.
 

Community Forums  

Do you have a feature request? Cloudinary usage tips & tricks you can share? Best practices and recommendations? Please head to our community forums and share your Cloudinary thoughts with the rest our community. This way everyone will be able to enjoy your insights!
 
Contemplating between different possible usage scenarios? Have burning questions you want to share with other developers like you? In our community forums you can share your thoughts with others just like you.
 

Outside Cloudinary 

Cloudinary's support team is also very active on other technical forums throughout the web. Any Cloudinary related question asked on Stack Overflow should get a quick answer, and we constantly monitor GitHub requests for anything related to Cloudinary's various open-source client integration libraries. 
 
Prefer social networking? We are always active on Twitter and Facebook, offering support and occasional tips and waiting to hear your feedback close and personal.
 

To Summarize

We are doing our best to make Cloudinary as simple and as effective to use as we possibly can. In time, we hope that our new support infrastructure will be a place that can both improve your Cloudinary experience and at the same time help us understand what's important to you, allowing us to continue building the best cloud-based image storage, management, manipulation and delivery platform available.
 
Let us know what you think - does the knowledge base answers your questions? Do you find our ticketing system easier to work with? Can our community forums offer solid advice? We would love to get your feedback!
 

Top 10 mistakes in handling website images and how to solve them

Jan 30, 2013 by Itai Lahan
Images are a major part of any modern website. Images nowadays account to more than 60% of a website's total bandwidth. This is even more pronounced when dealing with cutting-edge web design. On an image rich social website employing a Pinterest-like layout, this number can reach upward of 85% (!).
 
Bandwidth is unfortunately a costly commodity. For high traffic websites, bandwidth will probably be responsible for the majority of your IT costs, easily surpassing hosting and storage costs. In addition, such a large volume of traffic takes time to consume, and so, when browsing your website, your visitors are likely to spend a lot of time waiting for images to load. 
 
Looking at the IT costs from one end and visitor abandonment due to lengthy load times on the other, you would probably like to take a good look at how you manage your images online. When every second passing reduces your website's overall conversion and ultimately revenues - it makes perfect sense to want to optimize your image and image delivery as much as possible.
 
With Cloudinary, we wanted to give a conclusive solution to everything image related on a website and mobile app. You're covered from upload through storage, manipulation, optimization and delivery. As a developer, you don't need to worry about image-related R&D and IT anymore.  
 
Cloudinary solves a large number of common image related issues. For developers who are not yet using Cloudinary, we thought it might be helpful if we list some of these issues that we tend to encounter on a daily basis and how they can (and should) be solved:
 

1. Wasteful browser-side resizing

One of the common shortcuts we've seen developers employing is using browser-side image resizing instead of resizing images on the server-side.
 
The story is usually the same - the website had lots of thumbnails of certain dimension and then the graphics design changed. The new graphics design calls for the thumbnails to be of a slightly different dimension and the developers, sometimes accidentally and sometimes intentionally, leave the original images as is and use different CSS width and height for the browser.
 
On modern browsers, the end result looks exactly the same, but bandwidth-wise the story is quite different. Your website visitors are wasting precious time downloading an unnecessarily large image and you’ve wasted bandwidth delivering it to them. For older browsers the problem is even more pronounced as their resizing algorithms are usually sub-par.
 
This problem is actually much more common than you might think and is found in many of the websites we visit daily. For example, looking at Yahoo’s front page, you’ll notice that all the thumbnails on the "most popular" stories are downloaded double in pixels than their actual viewing size.
 
 
How to fix: Developers / designers - make sure the images you deliver perfectly fit their required website dimensions. Even if the same image should be made into different sized thumbnails to fit different pages, it’s well worth creating all these different thumbnails rather than deliver a large image and rely on the browser to resize it.
 

2. Unnecessarily high quality JPEGs

JPEGs have truly revolutionized the web. For many years now, this lossy format has allowed web developers to depict high resolution images with great detail using a fraction of the bandwidth required by any rival image format.
 
Still, we're constantly seeing developers and graphics designer who refrain from experimenting with the JPEG compression. In fact, in the majority of websites out there, you can safely reduce the JPEG quality settings a notch without a discernible loss in viewing quality.
 
While 85% JPEG quality seems common, we've seen many websites in which 95% quality was common while a much lower quality would have significantly reduced file size without harming the overall experience. The end result is a higher bandwidth consumption and a dent in the visitors experience.       
 
          
 
The above two images are quite similar to one another, while the left is a 95% JPEG that weighs 34KB while the right is an 80% JPEG that weighs 17KB, requiring half the bandwidth to download and loads twice as fast. Well worth the miniscule loss in quality.
 
How to fix: don't be afraid to experiment with lower JPEG quality levels. For certain websites we found that using a 50% JPEG quality yielded a very reasonable result and for us, these benefits far outweighed the costs. While higher quality JPEGs will always look better, the improvement in quality will not always be worth the extra bandwidth and waiting times.
 

3. Incorrect image file types

The three ruling file formats on the web today are JPEG, PNG and GIF. JPEGs and GIFs account to ~40% of the images on average websites while PNG covers the remainder 20%.
 
The good (and bad) about these three formats is that each one has very different roles when websites are involved. Use the wrong image format and you’re wasting your visitors time and your own money.
 
In Cloudinary, the most common mistake we're seeing is using PNGs to deliver photographs. There is a common misconception that PNGs, as lossless formats, will yield the highest possible reproduction for the photos. While this is generally true, this is also quite an unnecessary optimization. A JPEG with relatively high quality will return a photo of a comparable quality using a fraction of the PNGs file size.
              
          
 
The photo on the left is a PNG and it weighs a whopping 110KB. The photo on the right is a JPEG, looks nearly identical and weights just 15KB (!).
 
How to fix: Always keep in mind what image format should be used for the content shown. PNG should be used for computer generated images (charts, logos, etc.) or when you need transparency in your image (image overlays). JPEG should be used when you are showing a captured photograph. GIF should be use when animation is needed (Ajax loading animation, etc.). Notice that despite the common belief, PNG will outperform GIF in almost every other aspect.
 

4. Delivering non-optimized images

Did you know that while PNG is a lossless format, you can compress it even further? freely available PNG compression tools will reduce the PNG size by up to 50%, delivering the exact same image (!). Same exact image for half its file size? that’s a no brainer. Unfortunately, many developers and web designers skip this step and deliver non-optimized images.
 
How to fix: PNGCrush and OptiPNG are two open-source image optimization libraries, and if you're not using these already, you should definitely check them up. If you don’t need to automate the optimization process, you can head to Yahoo’s online smush.it service to manually compress your PNGs even further.
 
An example of Yahoo smush.it in action.
 
 

5. Forgetting to strip image meta-data

Many modern websites allow visitors to upload photographs. Whether it's the user's profile picture or a shared photo from a recent trip, these were originally taken using a modern camera, that most likely introduced a lot of meta-data into the photo.
 
This meta-data, arriving in EXIF/IPTC format, contains a wealth of information about the camera and photo, including the camera model, date and time information, aperture, shutter speed, focal length, metering mode, ISO, geo location and many others snippets of information.
 
In the majority of the cases, it would be an excellent idea to strip this meta-data off. This is good both for privacy and for reduced file size. Unfortunately, we rarely see developers taking the time to strip this meta-data off, increasing their bandwidth and hurting their users' browsing experience.
 
How to fix: make sure you strip the meta-data off your images and user uploaded photos. If this information is necessary, make sure you keep it available somewhere, just not as part of your images. One tip - even if the image meta-data is not necessary for your website, there's one snippet of information, the image’s original shooting orientation, that’s actually critical for correctly displaying the photo on your website. When stripping the Exif info, make sure you rotate the image to its correct orientation based on its Exif data before losing this information.
 

6. Delivering images straight from your servers 

Once your website’s content is in place, your next goal is to make sure that all your website's images are delivered as fast as possible to your visitors.
 
In Cloudinary, one of the common website problems we see is developers hosting images on their own servers, usually on the same machine as their website. Two things happen here - first, your server strains in delivering images instead of focusing on delivering your unique website content, and the second - you’re missing out on one of the most amazing image delivery solutions out there - Content Delivery Networks.
 
 
 
How to fix:  Content Delivery Networks are simple to use services that serve your website images much faster than how your website hosting service can deliver them. CDNs are based on a large number of world-wide servers, or "edges". When visitors visit your website, they are automatically routed to the nearest edge location, so images are delivered with the best possible performance with a much reduced latency. CDNs are priced by the required bandwidth and are slightly costlier than your hosting provider's bandwidth, but the CDN prices today are quite affordable and well worth it.
There are many CDN providers available today. Just sign up and start reaping the benefits. Amazon's CloudFront should be a good starting point.
 

7. Delivering static icons one by one 

Other than photos and thumbnails, your website most likely includes many icons and auxiliary images. Logos, arrows, stars, signs, marks, all enhance your website and give it its unique look and feel. Button pieces, portion of shadows, border parts and other snippets allows you to dynamically build all the widgets required by your graphics designer.
 
You'd be surprised at just how many tiny images your website can accumulate. Take Google Search results pages for example. You probably use this page on a daily basis and remember its very clean look. Almost no icons there, right? Wrong. Google's search results page is comprised of over 80 (!) tiny icons.

 
A common mistake developers make is embedding these small icons as-is in their website. The time it takes for a modern browser to download so many images is quite large. While downloading an image, we suffer from a communication latency and since an average browser supports no more than ~6 images downloaded simultaneously, this latency is multiplied for every batch of images downloaded. Your visitors will need to wait for their browsers to finish downloading all these small images and your web server might become unresponsive, processing so many download requests. Your visitors might even give up on the waiting and just continue on with their daily browsing.
 
How to fix: A simple solution for this problem is to utilize a CSS Sprite, a single image that contains all your smaller icons. Your web page is modified to download this single image from your server and the page’s HTML uses alternative CSS class names to point to the smaller images within the larger one. 
 
Now, instead of 80 images, Google's visitors download just a single image. Their browser will quickly download and cache this single image from Google's servers and all images will be immediately visible.
 

8. Using images when CSS3 can be used

When cutting a website's design into HTML components, many developers keep their buttons as images. Since older browsers did not support adding shadows, rounded corners and special fonts using CSS, developers got used to using small image snippets to implement these elements using an image-based solution.
 
Unfortunately, this solution requires a huge number of images that ultimately hurts the visitor's browsing experience and is very difficult to manage, increasing development time and costs (think changing words in a text embedded in an image).
 
Modern browsers today natively support shadows, rounded corners and unique fonts using simple css directives, still, we continue to see websites using images to implement these. This is actually a very common malpractice. For example, take a look at this portion of CNN's sprite image -
 
 
This sprite is a 61KB image that could have been easily implemented using simple CSS directives, improving load times and user experience while reducing bandwidth costs.
 
How to fix: make sure you use CSS3 whenever possible. If your graphics designer is responsible for the markup, make sure you ask for CSS3 based elements where it makes sense. If you want to support older versions of IE, you should either make sure your markup gracefully degrades to a functioning design (though probably looking less than perfect), or alternatively employ a CSS3 emulation solution such as CSS3 PIE.
 

9. Incorrect image cache settings

Your website's image files rarely change. HTTP caching directives allows such images to be cached by your visitors' browsers and any other server along the way (CDN, proxies, etc.). Once an image is cached, the locally cached copy will be used instead of having to download it again and again on subsequent visits to your website. 
 
Correct cache settings improves user experience by reducing page load time while saving you costs by significantly reducing your website's bandwidth.
 
Unfortunately, we see many cases in which caching isn't utilized correctly. The most common case is due to an unnecessary concern that a lengthy cache settings will mean that if images are updated, your website visitors will keep seeing old images instead of your new ones.
 
This seemingly problematic scenario is however easily avoided by adding a fingerprint (md5, timestamp, etc.) to your images urls. By adding a fingerprint to your image URLs you make sure that when an image changes, so does its URL. When the URL changes, the browser is forced to re-fetch the image. Most modern web development platforms automatically add such a fingerprint to all your images, solving this problem at its source.
 
How to fix: we highly recommend using aggressive caching for all your website images by setting your images HTTP 'Expires' header to as far in the future as possible. In addition to image URL fingerprints, this should offer an immediate increase in your website's performance.
 

10. Using a single image size across all delivery mediums 

Your website is being viewed by many different devices. Recent years saw a huge rise in mobile and tablet users and checking your website analytics should show a rising number of such visitors. 
 
Whether you have occasional mobile visitors or you've tuned your website to offer a mobile version of your website's content, you are still left with a decision to make - how to send the same image content to mobile devices that will usually have a much lower resolution than a desktop machine.
We usually see developers taking the fast route here, namely, offering the same exact images across all device resolutions, using client-side resizing for the images. While the images look great, the users waste time loading unnecessarily large images to their devices and you pay for redundant bandwidth usage. This is particularly unfair to 3G users and roaming users who pay a large extra to download the uselessly extra high resolution images. 
 
The symmetrical case is aiming for the lowest common denominator, making very low resolution images available across all devices, making your website look bad on newer, high resolution devices.
 
How to fix: the solution is pretty simple - identify your visitors mobile devices and resolution using their user agent and optionally additional client-side Javascript code. With the correct resolution in hand, retrieve the best fitting image from your servers. This of-course requires that you make available a set of thumbnails per each of your original images. There are excellent Javascript packages available that will automate this process.
 

Final Words

In this article, we've tried to list the most common image-related website issues we encounter at Cloudinary on a daily basis. While certainly not conclusive, we did our best to highlight the issues that are most cost effective to solve and offer a general explanation you should be able to use as a starting point to research for a solution that works best for you.
 
If you haven't heard about Cloudinary yet, you will be happy to know that Cloudinary already solves all of the issues described above and then some. Every image uploaded to Cloudinary can be dynamically transformed to any thumbnail size, file format and quality so you're able to easily test different settings that best fit your website and user expectations. Cloudinary offers simple, manageable Sprite creation. All images are automatically stripped and optimized in size and delivered from a fast CDN using correct cache settings, employing nearly every best practice in the book. Finally, Cloudinary's cloud-based dynamic image resizing capabilities are a perfect fit for responsive design.
 
Cloudinary actually offers much more than that, managing your images uploads and cloud-based storage and is free to sign up. Check Cloudinary out, and let us know what you think. Also, if we've missed anything crucial in the list above, please tell us about in the comment thread below. Much appreciated!

cloudControl PaaS add-on for cloud-based image management

Jan 23, 2013 by Itai Lahan
More and more developers are getting to know the power of the cloud. In today's web application development world you can leverage the cloud to build large scale applications so quickly and easily that it's simply mind-boggling that you get all of this while still keeping on a very reasonable budget. 
 
For many developers, it took quite some time to overcome the natural not-invented-here syndrome and start trusting cloud services over the traditional in-house solutions. But it seems that we've already pass this hurdle and most recent web and mobile apps are counting heavily on cloud services to deliver them great solutions that cover important features, save crucial dev & support time, reduce dev costs and remove unnecessary development challenges.
 
Platform-as-a-Service (PaaS) is an a example of such a great cloud-based solution. In the PaaS case - moving your application deployment to the cloud. Simply write the code of your core application, run a command or two and you a have a fully working and scalable application available online. 
 
cloudControl is a popular european PaaS provider. Founded in 2009 in Germany, cloudControl provides a great solution for development and deployment of web applications in PHP, Ruby, Python and Java. 
 
 
Developers that manage their applications in a PaaS still needs to manage the image pipeline of their applications. This is where Cloudinary comes in. Today we are excited to announce that Cloudinary's add-on for cloudControl is available for the general public. Ruby on Rails developers? Django experts? PHP programmers? You can now develop and deploy your applications using cloudControl and use Cloudinary as an add-on in a single click or a simple command line.
 
With Cloudinary's add-on for cloudControl you can upload all your images to a highly available, safe and secured, backed-up cloud storage, perform various image transformation and manipulation in the cloud without installing any complex software and get all your images optimized and delivered to your users through a fast content delivery network (CDN) employing advanced caching techniques.
 
The add-on can be installed through cloudControl's portal:
 
 
We've prepared a detailed documentation for using Cloudinary as an add-on for cloudControl. Check out this documentation page for overview of the Cloudinary service, add-on installation and usage instructions, and integration guides for cloudControl's PHP, Ruby and Python platforms.
 
One of our targets is to make Cloudinary available to as many platforms as possible in the easiest-to-use way as possible. Today we are happy to add cloudControl to our family of high-end platform providers. It would be great if you try out cloudControl and Cloudinary's add-on. We'd appreciate your feedback.
More posts...