Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

How to use PERL get the properties of a Flash file

by sureerat (Acolyte)
on Nov 14, 2008 at 20:12 UTC ( #723718=perlquestion: print w/ replies, xml ) Need Help??
sureerat has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I question whether it is possible to write PERL script to check the width and height of a FLASH file. Please suggest.

I've tried to find the answer from google but unfortunately I can't find. I believe perlmonks can help me. Thanks in advance. ^_^

Comment on How to use PERL get the properties of a Flash file
Re: How to use PERL get the properties of a Flash file
by Illuminatus (Curate) on Nov 14, 2008 at 20:22 UTC
      Tested.
      my $info = ImageInfo($qfn); die "..." if exists($info->{Error}); die "..." if !exists($info->{ImageSize}); my ($x, $y) = $info->{ImageSize} =~ /^(\d+)x(\d+)\z/ or die "...";
Re: How to use PERL get the properties of a Flash file
by ikegami (Pope) on Nov 14, 2008 at 20:22 UTC

    Off the top of my head:

    Get swfdump from SWFTOOLS (GPL)

    # Windows syntax my $size = `swfdump -X -Y "$qfn"` or die "..."; my ($x, $y) = $size =~ /^-X (\d+) -Y (\d+)$/ or die "...";

    I strongly recommend a solution that doesn't use an external program.

    By the way, it's not called PERL. It's not called FLASH either.

    Update: Added missing "= $size". Tested. Added recommendation.

Re: How to use PERL get the properties of a Flash file
by MidLifeXis (Prior) on Nov 14, 2008 at 20:22 UTC
      Thank you very much to you all for the guideline.

      I will test Image::ExifTool::Flash, ImageInfo and SWFTOOLS for my knowledge before choosing to use on my script.

Re: How to use PERL get the properties of a Flash file
by valdez (Monsignor) on Nov 15, 2008 at 18:15 UTC
      Thank you Valerio. I'm interested to try FLV::Info also. I will test it. ^_^

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://723718]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2014-09-22 09:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (185 votes), past polls