I am available for freelance work! Click here to email me.

Calculating an Images Orientation using Paperclip

Thursday, June 10th, 2010

If you ever need to know if an image is portrait or landscape in orientation, you can do the following (assuming you have an orientation attribute on your model:
class Image < ActiveRecord::Base
# Paperclip
has_attached_file :file

# Callbacks
before_create :set_orientation

protected

def set_orientation
original_file = self.file.to_file(:original)
[...]

Posted in Ruby on Rails | Tags: , , | Comments

Speeding Up Rails Development

Saturday, November 15th, 2008

Over the last few months I’ve realised that the speed at which I develop new projects is a lot quicker than it used to be. So I thought I’d share some of the things I’ve learned and also some quite obvious things (to me at least).
Use a Base Application
I’m obviously going to be horrifically biased [...]

Posted in Ruby on Rails | Tags: , , , , | Comments

Purify - Issue Tracker

Jim Neath is a 26 year old Freelance Ruby on Rails developer from Manchester, UK.

Recommend Me

Categories