# Embeding Flash With Ruby

**URL:** <https://www.ruby-forum.com/t/embeding-flash-with-ruby/127468>\
**Category:** Rails\
**Created:** [January 29, 2008, 4:26pm UTC](https://www.ruby-forum.com/t/embeding-flash-with-ruby/127468 "2008-01-29T16:26:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 29, 2008, 4:26pm UTC](https://www.ruby-forum.com/t/embeding-flash-with-ruby/127468/1 "2008-01-29T16:26:38Z")

</div>

Hi, All,  
i am working on an application that will allow my users to upload  
files and then display these files on a generated page. file types  
that they will be uploading include flash SWF files. is there any way  
of including SWFs dynamically with ROR so that the dimensions of the  
file are set. in PHP there is the getImageSize function that can read  
the dimensions of a swf. any such equivalent in Ruby or Rails … ?  
any sort of solution would be great such as one involving the swf  
object or some rails function like ‘flash\_for’ which someone mentioned  
but I cannot find any info on… ANYONE HELP!!!

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 29, 2008, 5:08pm UTC](https://www.ruby-forum.com/t/embeding-flash-with-ruby/127468/2 "2008-01-29T17:08:40Z")

</div>

On Tue, 29 Jan 2008, removed\_email\_address@domain.invalid wrote:

> in PHP there is the getImageSize function that can read  
> the dimensions of a swf.

Correction: that is a GD function, so you will need to find use  
something  
like ruby-gd perhaps

–

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 29, 2008, 5:47pm UTC](https://www.ruby-forum.com/t/embeding-flash-with-ruby/127468/3 "2008-01-29T17:47:15Z")

</div>

I had faced a similar requirement but have yet to find a solution.  
However in practice it is better  
to set a fixed dimension (either width or height) and set the second  
base on a desired aspect ratio  
(4:3 or 16:9).

I’ve used this approach here:

[http://fatdrive.tv/pofo/trakb/29-Media+Player+Plugin+Test](http://fatdrive.tv/pofo/trakb/29-Media+Player+Plugin+Test)

– Long  
[http://FATdrive.tv/wall/trakb/10-Long](http://FATdrive.tv/wall/trakb/10-Long)  
[http://FATdrive.tv/](http://FATdrive.tv/)

----- Original Message -----  
From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: “Ruby on Rails: Talk” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Tuesday, January 29, 2008 10:25 AM  
Subject: [Bulk] [Rails] Embeding Flash With Ruby

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 1, 2008, 4:56am UTC](https://www.ruby-forum.com/t/embeding-flash-with-ruby/127468/4 "2008-02-01T04:56:12Z")

</div>

only solution i found is libimage-size-ruby …  
[http://snippets.dzone.com/posts/show/805](http://snippets.dzone.com/posts/show/805)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 11, 2008, 6:35pm UTC](https://www.ruby-forum.com/t/embeding-flash-with-ruby/127468/5 "2008-02-11T18:35:58Z")

</div>

[http://code.google.com/p/ruby-imagespec/source/checkout](http://code.google.com/p/ruby-imagespec/source/checkout)

a coworker of mine made this. its the only straightforward solution  
for reading swfs that i have seen.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 11, 2008, 6:36pm UTC](https://www.ruby-forum.com/t/embeding-flash-with-ruby/127468/6 "2008-02-11T18:36:33Z")

</div>

[http://code.google.com/p/ruby-imagespec/source/checkout](http://code.google.com/p/ruby-imagespec/source/checkout)

a coworker of mine made this. its the only straightforward solution  
for reading swfs that i’ve seen.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 11, 2008, 6:38pm UTC](https://www.ruby-forum.com/t/embeding-flash-with-ruby/127468/7 "2008-02-11T18:38:19Z")

</div>

[http://code.google.com/p/ruby-imagespec/source/checkout](http://code.google.com/p/ruby-imagespec/source/checkout)

a coworker of mine made this. its the only straightforward solution  
for reading swfs that i’ve seen.
