Jim Neath

Manchester based Ruby on Rails & Facebook App Developer

This is a just a quick post that will hopefully save some people a hell of a lot of time.

If you’re trying to get the width and height of a flash file, a banner for example, then you can use the ImageSpec library by Brandon Anderson.

You can checkout the code with the following:

svn checkout http://ruby-imagespec.googlecode.com/svn/trunk/ vendor/plugins/ruby-imagespec

Then call it in your code to get the dimensions of a flash movie. Say you’re using Paperclip, then you could do the following:

dimensions = ImageSpec::Dimensions.new(@banner.file.path)
dimension.height # Get the height
dimesions.width # Get the width


blog comments powered by Disqus

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

Jim Neath is a Freelance Ruby on Rails & Facebook app developer from Manchester, UK, currently working for Engine Yard.