Faux Cropping with CSS, Jquery and Rails Helpers

May 10th, 2014 - Göttingen

We’ve been using a CSS technique to resize and position an image inside a container as if it had been cropped. The goal was to provide an image to the user as quickly as possible, before the background image processors finished, and this let us make use of the original image for a couple of seconds.

We are changing to another aproach, and as a way to remember this technique and play a little with gems & plugins, I extracted it to a Jquery Plugin (Jquery Faux Crop) and a Rails gem (Rails Helper Faux Crop).