Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

getting SWF dimensions (width and height )

Name: Anonymous 2007-04-29 14:04 ID:a78rIU2Q

Hi everyone.

I finally got my site to work. The only problem I have is with properly displaying flash files. I have to specify height and width for every file.

Something like...

<embed src="something.swf" quality=high type="application/x-shockwave-flash" width="640" height="480"></embed>

 otherwise the animation won't be displayed properly (it will show nasty stuff on right and left or just won't look good).

I have loads of swf files I need to get this somehow automated. There has to be a way to either get the around this problem or to somehow "detect" the swf dimensions.

Is there any "trick" for this?

I'm using PHP and GNU/Linux.

Name: Anonymous 2007-04-29 14:13 ID:tc7k3mK4

>Hi everyone.
>I'm using PHP and GNU/Linux.

sorry but is that even relevant to the topic, or is it just your way of saying "Ive read GNU/Linux"?

Name: Anonymous 2007-04-29 14:22 ID:a78rIU2Q

OP here.

>>2
"Hi everyone." - because "it's nice to be nice"
"I'm using PHP and GNU/Linux." - because I would prefer to get this done somehow in this environment. I think it's relevant to the topic.

Anyway, I found something but it requires VBScript and ASP which I do not want to use.

http://www.4guysfromrolla.com/webtech/tips/t102001-1.shtml

Any ideas?

Name: Anonymous 2007-04-29 14:26 ID:7NpagZGS

http://www.4guysfromrolla
Stopped reading right there.

Name: Anonymous 2007-04-29 14:36 ID:a78rIU2Q

>>4
Thanks for informing us.

Does anyone else have any ideas?

Name: Anonymous 2007-04-29 14:47 ID:O1P4wkGQ

No one likes a website with loads of swf files.
You might try a macro though or if the dimensions you want are somewhere in the file, use awk on it and get some raw data like "filename xxx yyy" and convert that to your embed tags.

Name: Anonymous 2007-04-29 14:48 ID:byAGIaJ6

>>5
I have 15000 ideas

Name: Anonymous 2007-04-29 14:49 ID:8AEi+SN/

Name: Anonymous 2007-04-29 15:06 ID:a78rIU2Q

>>6

>No one likes a website with loads of swf files.

What I meant is I have a lot of flash movies from various sources and it would take too long to go through all of them manually. I'll get them displayed one at a time, no worries. :-)

>if the dimensions you want are somewhere in the file, use awk on it and get some raw data

The problem is I don't know which bytes of swf contain the dimensions, otherwise I'd write some util myself.

>>8

I'll check it out right now. Thanks!

Name: Anonymous 2007-04-29 15:09 ID:tc7k3mK4

>>8
doesnt work

Name: Anonymous 2007-04-29 15:32 ID:a78rIU2Q

OP here.

>>10
How do you mean?

Anyway. I installed Data::TemporaryBag and SWF::BinStream::Codec as >>8 suggested.

I checked the manual and it looks like it does provide a way to check the values I'm looking for:

$xmin, $ymin, $xmax, $ymax:
     Boundary rectangle size of frames, ($xmin,$ymin)-($xmax, $ymax), in TWIPS(1/20 pixels).


Now, I'm not THAT good (yet) at perl. Thanks for your advice >>8 and sorry if I'm asking for too much but can you paste a "hello world" type example for total nubs showing how to use it? I'll try to look it up on the net now btw.

Name: Anonymous 2007-04-29 15:35 ID:85tvDy12

>>5
I have over 15000 ideas

Name: Anonymous 2007-04-29 15:41 ID:a78rIU2Q

>>12

Great, thank you for telling us.

Does anyone else want to contribute?

Name: Anonymous 2007-04-29 15:58 ID:a78rIU2Q

OK, I'll try to write it myself. I created a swfinfo.plx with x permission. So far I have:

#!/usr/bin/perl

use SWF::Parser;

$parser = SWF::Parser->new( 'header-callback' => \&header, 'tag-callback' => \&tag);
# parse a file
$parser->parse_file( 'test.swf' );



How do I go next? Halp a nub?

Name: Anonymous 2007-04-29 16:11 ID:7NpagZGS

>>13
I have over 15000 ideas WRITTEN DOWN.

Name: Anonymous 2007-04-29 16:11 ID:7NpagZGS

Oh, and all of them are related to hockey games.

Name: Anonymous 2007-04-29 16:18 ID:a78rIU2Q

>>15
>>16

Thats GREAT.

I think I'll read a perl tutorial or something to not to be a noob any more. Hmmmm...

...orz

Name: Anonymous 2007-04-29 16:20 ID:PmAUFzEu

try /5$^$%(#$^#&$%##/&^*&(

Name: Anonymous 2007-04-29 16:28 ID:a78rIU2Q

>>18

Wow.

Your amazing wit astounds me, to the point that I don't know if I should laugh or not.

Name: Anonymous 2007-04-29 16:47 ID:efJe8HM+

Getting the dimensions involves zlib decompression and some slight bit manipulation. It's not that difficult. If you think you can figure that out, get the swf spec (Google).

Name: Anonymous 2007-04-29 17:31 ID:T8ehtLtC

>>19

lol your momma

Name: Anonymous 2007-04-30 2:23 ID:Zeha1R+a

>>1
aaaaaaaaaaaaaarrrrrrrrrrrrrrgggggggggggggggghhhhhhhhhhhhhhh!!!!!!!!!!!

Name: Anonymous 2007-04-30 3:48 ID:VGEgFFwa

>>21
thanks for telling us

anyone else wants to contribute?

Name: Anonymous 2007-05-01 10:05 ID:dXGvBBmj

OK, anyways...

OP here I think I found the best and easiest solution for me.

There's a deb package called "swftools". One can obtain it and install it easily on a Debian based GNU/Linux operating system by typing

apt-get install swftools

So what I'm doing is for every swf file on my page I'm executing this system command via php:

$swfdump somefile.swf -X -Y

...and it returns me the specs I need. Yay! Later I'll create a database or something for this to not to overload the cpu.

 >>8 may be useful once I learn to perl, atm I'm not too good at it.

Thanks everyone for posting and bye.

Name: Anonymous 2007-05-01 10:29 ID:8h/tSBXv

1. Get the file format specifications
http://www.wotsit.org/list.asp?search=swf&button=GO%21
2. Study it
3. Open the file for binary reading, seek to the offset containing what you need and read it.
4. ???
5. SEGFAULT

Name: Anonymous 2007-05-05 10:30 ID:Heaven

>>25
lol'd

Name: Anonymous 2009-01-14 14:36

lol sepples

Name: Anonymous 2009-03-06 7:47


Else if KillInfo iTempKills.

Name: Sgt.Kabu뎨섗kiman枽蕬 2012-05-29 0:56

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List