Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print SWF(file) not working. #16

Open
jdcrunchman opened this issue Jun 25, 2014 · 14 comments
Open

Print SWF(file) not working. #16

jdcrunchman opened this issue Jun 25, 2014 · 14 comments

Comments

@jdcrunchman
Copy link

from swf.movie import SWF <--- works fine
file = open('CT12KORJ001.swf', 'rb' ) <---- works fine
print SWF(file)

Traceback (most recent call last):
  File "", line 1, in
  File "build/bdist.macosx-10.8-intel/egg/swf/movie.py", line 87, in init
  File "build/bdist.macosx-10.8-intel/egg/swf/movie.py", line 143, in parse
  File "build/bdist.macosx-10.8-intel/egg/swf/tag.py", line 112, in parse_tags

Why am I getting this? Where have I made my mistake, Did I leave anything out? Did the install go badly? It didn't indicate so.

Please also reply to my email - [email protected]

John

@skrat
Copy link
Collaborator

skrat commented Jun 25, 2014

The stack trace is not complete, could you paste the complete one?

@jdcrunchman
Copy link
Author

Yes, here's the full stach trace

swf = SWF(file)
Traceback (most recent call last):
File "", line 1, in
File "build/bdist.macosx-10.8-intel/egg/swf/movie.py", line 87, in
init
File "build/bdist.macosx-10.8-intel/egg/swf/movie.py", line 143, in parse
File "build/bdist.macosx-10.8-intel/egg/swf/tag.py", line 112, in
parse_tags
File "build/bdist.macosx-10.8-intel/egg/swf/tag.py", line 130, in
parse_tag
File "build/bdist.macosx-10.8-intel/egg/swf/tag.py", line 1313, in parse
File "build/bdist.macosx-10.8-intel/egg/swf/stream.py", line 200, in
readSHAPE
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 50, in init
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 56, in parse
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 92, in
read_shape_records
File "build/bdist.macosx-10.8-intel/egg/swf/stream.py", line 216, in
readSTYLECHANGERECORD
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 605, in
init
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 522, in
init
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 620, in parse
File "build/bdist.macosx-10.8-intel/egg/swf/stream.py", line 220, in
readFILLSTYLE
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 757, in
init
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 770, in parse
Exception: ('Unknown fill style type: 0x36', 1)

On Wed, Jun 25, 2014 at 3:27 AM, Dušan Maliarik [email protected]
wrote:

The stack trace is not complete, could you paste the complete one?


Reply to this email directly or view it on GitHub
#16 (comment).

@jdcrunchman
Copy link
Author

Here is a sample SWF file I've attached that causes this problem. I sure
would like to know whats going on.

On Wed, Jun 25, 2014 at 4:47 AM, John Draper [email protected] wrote:

Yes, here's the full stach trace

swf = SWF(file)
Traceback (most recent call last):
File "", line 1, in
File "build/bdist.macosx-10.8-intel/egg/swf/movie.py", line 87, in
init
File "build/bdist.macosx-10.8-intel/egg/swf/movie.py", line 143, in parse
File "build/bdist.macosx-10.8-intel/egg/swf/tag.py", line 112, in
parse_tags
File "build/bdist.macosx-10.8-intel/egg/swf/tag.py", line 130, in
parse_tag
File "build/bdist.macosx-10.8-intel/egg/swf/tag.py", line 1313, in parse
File "build/bdist.macosx-10.8-intel/egg/swf/stream.py", line 200, in
readSHAPE
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 50, in
init
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 56, in parse
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 92, in
read_shape_records
File "build/bdist.macosx-10.8-intel/egg/swf/stream.py", line 216, in
readSTYLECHANGERECORD
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 605, in
init
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 522, in
init
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 620, in parse
File "build/bdist.macosx-10.8-intel/egg/swf/stream.py", line 220, in
readFILLSTYLE
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 757, in
init
File "build/bdist.macosx-10.8-intel/egg/swf/data.py", line 770, in parse
Exception: ('Unknown fill style type: 0x36', 1)

On Wed, Jun 25, 2014 at 3:27 AM, Dušan Maliarik [email protected]
wrote:

The stack trace is not complete, could you paste the complete one?


Reply to this email directly or view it on GitHub
#16 (comment).

@timknip
Copy link
Owner

timknip commented Jun 26, 2014

You didn't attach the file :)

It seems your SWF contains an invalid fillStyle 0x36...
Could be that recent versions of Flash introduced a new fillStyle.
What Flash version did you use to create this SWF?

A possible workaround would be to save your movie as an older version like 10.

Note that pyswf hasn't been updated for quite a while, so pyswf may fail on SWF versions 11 or higher.

@jdcrunchman
Copy link
Author

Good question. This SWF file came from the Thailand Yellow Pages CD, and we wanted to be able to extract text data from it.

Sent from my iPad

On Jun 26, 2014, at 8:12 PM, timknip [email protected] wrote:

You didn't attach the file :)

It seems your SWF contains an invalid fillStyle 0x36...
Could be that recent versions of Flash introduced a new fillStyle.
What Flash version did you use to create this SWF?

Is there anyway to modify the python code to ignore this full style.
A possible workaround would be to save your movie as an older version like 10.

It's not really a movie, it's a static SWF file. By the way, I delegated Bob Ackerman to take over this project, he was CCed in this message, you should work with him. I had to detach myself from this project due to health reasons. Back pain so intense, I had to go to hospital here In Bangkok.

Where are you located? Need to know, for time zone reasons.

Note that pyswf hasn't been updated for quite a while, so pyswf may fail on SWF versions 11 or higher.

Is there anyway we can do something about that? Or is there another python module that's newer?

John


Reply to this email directly or view it on GitHub.

@jdcrunchman
Copy link
Author

interesting that there is a fill style in a supposedly pure text file. maybe the font is included in the text in which case it won't be a simple matter of exporting some unicode text. is there a standard thai alphabet in unicode?
perhaps build the module without throwing an exception on invalid style? source is on github.
interesting that it says the readme was updated 1 month ago, also, the parser it is based on was updated 2 months ago, but not pyswf. so, perhaps, we can drop in the newer parser into pyswf.
is tim interested in doing this project or is he just a helpful resource? would we collaborate?

On Jun 26, 2014, at 7:39 AM, John Draper [email protected] wrote:

Good question. This SWF file came from the Thailand Yellow Pages CD, and we wanted to be able to extract text data from it.

Sent from my iPad

On Jun 26, 2014, at 8:12 PM, timknip [email protected] wrote:

You didn't attach the file :)

It seems your SWF contains an invalid fillStyle 0x36...
Could be that recent versions of Flash introduced a new fillStyle.
What Flash version did you use to create this SWF?

Is there anyway to modify the python code to ignore this full style.
A possible workaround would be to save your movie as an older version like 10.

It's not really a movie, it's a static SWF file. By the way, I delegated Bob Ackerman to take over this project, he was CCed in this message, you should work with him. I had to detach myself from this project due to health reasons. Back pain so intense, I had to go to hospital here In Bangkok.

Where are you located? Need to know, for time zone reasons.

Note that pyswf hasn't been updated for quite a while, so pyswf may fail on SWF versions 11 or higher.

Is there anyway we can do something about that? Or is there another python module that's newer?

John


Reply to this email directly or view it on GitHub.

@jdcrunchman
Copy link
Author

oh, now i see that tim is the author of pyswf. :)
so tim is saying that his pyswf doesn't handle more recent swf versions. hmm.
well, my comment on using a newer parser still holds.
i am looking at swftools. i installed it ok, but i don't see how to use it. it seems there is a connection between pyswf and swftools? swftools seems to think so, but there is no mention of swftools in the pyswf github readme.

On Jun 26, 2014, at 7:39 AM, John Draper [email protected] wrote:

Good question. This SWF file came from the Thailand Yellow Pages CD, and we wanted to be able to extract text data from it.

Sent from my iPad

On Jun 26, 2014, at 8:12 PM, timknip [email protected] wrote:

You didn't attach the file :)

It seems your SWF contains an invalid fillStyle 0x36...
Could be that recent versions of Flash introduced a new fillStyle.
What Flash version did you use to create this SWF?

Is there anyway to modify the python code to ignore this full style.
A possible workaround would be to save your movie as an older version like 10.

It's not really a movie, it's a static SWF file. By the way, I delegated Bob Ackerman to take over this project, he was CCed in this message, you should work with him. I had to detach myself from this project due to health reasons. Back pain so intense, I had to go to hospital here In Bangkok.

Where are you located? Need to know, for time zone reasons.

Note that pyswf hasn't been updated for quite a while, so pyswf may fail on SWF versions 11 or higher.

Is there anyway we can do something about that? Or is there another python module that's newer?

John


Reply to this email directly or view it on GitHub.

@timknip
Copy link
Owner

timknip commented Jun 26, 2014

John,

It would really help if you send me the SWF so i can try provide you with a fix (Its not attached in the comment you posted earlier).

Please send it to tim at floorplanner dot com.

@jdcrunchman
Copy link
Author

i see that claus' parser is not a drop-in; pyswf is a translation into python of the parser code.
so the question is, can tim translate the most recent code from claus or tell us how to get around the 'fill' exception.

On Jun 26, 2014, at 10:47 AM, John Draper [email protected] wrote:

Ben, Bob writes this...

---------- Forwarded message ----------
From: ackerman dudley [email protected]
Date: Thu, Jun 26, 2014 at 9:18 AM
Subject: Re: [pyswf] Print SWF(file) not working. (#16)
To: John Draper [email protected]
Cc: timknip/pyswf [email protected]

interesting that there is a fill style in a supposedly pure text file. maybe the font is included in the text in which case it won't be a simple matter of exporting some unicode text. is there a standard thai alphabet in unicode?

Crunch: where can we get the Thai alphabet in Unicode.

perhaps build the module without throwing an exception on invalid style? source is on github.
interesting that it says the readme was updated 1 month ago, also, the parser it is based on was updated 2 months ago, but not pyswf. so, perhaps, we can drop in the newer parser into pyswf.
is tim interested in doing this project or is he just a helpful resource? would we collaborate?

If possible, Yes Bob... lets see of you can collaborate with timKnip and nail this sucka...

Crunch

On Jun 26, 2014, at 7:39 AM, John Draper [email protected] wrote:

Good question. This SWF file came from the Thailand Yellow Pages CD, and we wanted to be able to extract text data from it.

Sent from my iPad

On Jun 26, 2014, at 8:12 PM, timknip [email protected] wrote:

You didn't attach the file :)

It seems your SWF contains an invalid fillStyle 0x36...
Could be that recent versions of Flash introduced a new fillStyle.
What Flash version did you use to create this SWF?

Is there anyway to modify the python code to ignore this full style.
A possible workaround would be to save your movie as an older version like 10.

It's not really a movie, it's a static SWF file. By the way, I delegated Bob Ackerman to take over this project, he was CCed in this message, you should work with him. I had to detach myself from this project due to health reasons. Back pain so intense, I had to go to hospital here In Bangkok.

Where are you located? Need to know, for time zone reasons.

Note that pyswf hasn't been updated for quite a while, so pyswf may fail on SWF versions 11 or higher.

Is there anyway we can do something about that? Or is there another python module that's newer?

John


Reply to this email directly or view it on GitHub.

@timknip
Copy link
Owner

timknip commented Jun 26, 2014

Again. I need the SWF to debug the issue. Please attach it or mail it to me.

I need the file to reproduce the issue.

@jdcrunchman
Copy link
Author

Ok, those other files I sent were aliases. So are useless to you guys.
So, I've attached a real swf file to this message, and want to call
your attention to this link.

http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/swf/pdf/swf-file-format-spec.pdf

This is for reference only, but using this, and a Hex File editor, I
found NO CORRELATION to any of the data as described in this link.

john

On Thu, Jun 26, 2014 at 10:03 AM, ackerman dudley [email protected]
wrote:

oh, now i see that tim is the author of pyswf. :)
so tim is saying that his pyswf doesn't handle more recent swf versions.
hmm.
well, my comment on using a newer parser still holds.
i am looking at swftools. i installed it ok, but i don't see how to use
it. it seems there is a connection between pyswf and swftools? swftools
seems to think so, but there is no mention of swftools in the pyswf github
readme.

On Jun 26, 2014, at 7:39 AM, John Draper [email protected] wrote:

Good question. This SWF file came from the Thailand Yellow Pages CD,
and we wanted to be able to extract text data from it.

Sent from my iPad

On Jun 26, 2014, at 8:12 PM, timknip [email protected] wrote:

You didn't attach the file :)

It seems your SWF contains an invalid fillStyle 0x36...
Could be that recent versions of Flash introduced a new fillStyle.
What Flash version did you use to create this SWF?

Is there anyway to modify the python code to ignore this full style.

A possible workaround would be to save your movie as an older version like
10.

It's not really a movie, it's a static SWF file. By the way, I
delegated Bob Ackerman to take over this project, he was CCed in this
message, you should work with him. I had to detach myself from this
project due to health reasons. Back pain so intense, I had to go to
hospital here In Bangkok.

Where are you located? Need to know, for time zone reasons.

Note that pyswf hasn't been updated for quite a while, so pyswf may fail
on SWF versions 11 or higher.

Is there anyway we can do something about that? Or is there another
python module that's newer?

John


Reply to this email directly or view it on GitHub
#16 (comment).

@jdcrunchman
Copy link
Author

I thought I did.

Sent from my iPad

On Jun 27, 2014, at 1:17 AM, timknip [email protected] wrote:

Again. I need the SWF to debug the issue. Please attach it or mail it to me.

I need the file to reproduce the issue.


Reply to this email directly or view it on GitHub.

@ch3c05
Copy link

ch3c05 commented Dec 2, 2016

Same issue here, basically I can't get passed of simply printing the SWF structure at "print SWF(File)".
Issues start with:

pyswf/swf/movie.py", line 100, in init
self.parse(self._data)

Any ideas?

@jdcrunchman
Copy link
Author

jdcrunchman commented Dec 2, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants