Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

How to use PERL get the properties of a Flash file

by sureerat (Acolyte)
on Nov 14, 2008 at 20:12 UTC ( [id://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

Replies are listed 'Best First'.
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 (Patriarch) 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 (Monsignor) 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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-25 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found