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

Getting the Dimensions of a Flash (SWF) File

November 12th, 2008

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

Recommend Me

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.

You can follow any responses to this entry through the RSS 2.0 feed. Trackback from your own site.

  • Jay
    Can you recommend anything that will parse Quicktime width/height as well?
blog comments powered by Disqus
Purify - Issue Tracker

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

Recommend Me

Categories