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
Rad.
(Possibly) Related Posts
- Calculating an Images Orientation using Paperclip
- SWFUpload, Paperclip and Ruby on Rails
- Bort v0.2 Released
If you found this post or anything else on this site of any use, then please take the time to recommend me on Working with Rails.

