5

As we know the function getimagesize() works very good for images and swf files.

But it doesn't support shockwave file (.dcr).

SO, how can I get the width and the height of such file..

4

2 回答 2

2

I am not Lingo/Director expert, but AFAIK you won't be able to do this from PHP.

.DCR file format is not open so you won't find file format specification for you to make your own parser and extract that info on your own.

However, there should be way to do this using director movie on client side.

Eg. You load external dcr file inside your own director movie (then you will be able to read width/height etc of loaded file). Your own director movie then updates some database with info on that specific loaded file so you can show width/height later on.

I've found this artice dating back to 2006 where this guy suggests the same thing: http://director-online.com/forums/read.php?1,20621,20621,quote=1

Good luck mate! :)

于 2011-05-11T16:32:05.070 回答
-1

If you have a windows server, you could install IrfanView (free) and use it from the command line (yes, it's free and has a command line) to convert the swf to dcr. (Surely there is a similar tool for Linux).

Convert images on the command line with IfranView

To call OS command line from php, use shell_exec().

Then you could read the swf image size with php normally.

Hope this helps

于 2011-05-02T17:56:30.403 回答