SWF Information

This is the place for queries that don't fit in any of the other categories.

SWF Information

Postby pythonforever » Thu Dec 05, 2013 7:56 pm

Hello.

I am trying to get some information from swf file using hexagonit.swfheader module.
The orig file width and height are 160x600 and the size is 32.63 kB.

When I tried to get the same information by using hexagonit.swfheader everything
matches except size. It displays size as 55890. I am not very good at math
but is there a way to convert size 55890 to match 32.63 kB ?

The stats that I have are :

Code: Select all
Width:    160 px
Height:    600 px
File Size:    32.63 kB
Compressed:    1
Plugin Version:    8


Code used :
Code: Select all
import hexagonit.swfheader
metadata = hexagonit.swfheader.parse(r'C:\test.swf')

print metadata['width'], metadata['height']
print metadata['size']
print metadata['version']
print metadata['compressed']


Output :
Code: Select all
160 600
55890
8
True


On the page of hexagonit.swfheader it lists:

Code: Select all
size (int)

Byte size of the (uncompressed) contents of the SWF file.


Any help on how to convert size returned to kb?
Hope I did not make any mistakes in my desc?
Last edited by Yoriz on Thu Dec 05, 2013 8:05 pm, edited 1 time in total.
Reason: First post lock
pythonforever
 
Posts: 9
Joined: Thu Dec 05, 2013 7:18 pm

Re: SWF Information

Postby stranac » Thu Dec 05, 2013 8:39 pm

pythonforever wrote:Any help on how to convert size returned to kb?

Yes, just divide by 1024.
But it won't match the actual file size; your file is compressed, and this is the size of its uncompressed contents.
I don't think the file's actual size is stored in the header.

If you want to get the actual size of the file on your system, you can simply use os.path.getsize()
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1144
Joined: Thu Feb 07, 2013 3:42 pm

Re: SWF Information

Postby pythonforever » Thu Dec 05, 2013 8:59 pm

Thank you stranac for the fast reply.
pythonforever
 
Posts: 9
Joined: Thu Dec 05, 2013 7:18 pm


Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot] and 4 guests