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

Converting Videos with Rails: Converting the Video

Tuesday, June 3rd, 2008

So you’ve installed FFMPEG. Now it’s time to move onto converting the video. For this we’re going to be using a couple of plugins.
Paperclip
We will be using the paperclip plugin to upload the videos onto our server. Details of how to install paperclip can be found in my previous article: Paperclip: Attaching Files in Rails. [...]

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