-
-
Notifications
You must be signed in to change notification settings - Fork 841
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
render: Handle PNG and GIF data in DefineBitsJPEG tags (fix #530) #532
Conversation
@Dinnerbone could you try running this through |
9b86fc8
to
6482dff
Compare
Scanning now, so far it's successfully parsing some PNGs and there's no errors. Should be finished in a few hours, but I'll know of any errors before then. |
I hit a panic early in the scan whilst parsing https://www.newgrounds.com/portal/view/524451/format/flash?emulate=flash:
Before that, there was one JPEG that was broken: https://www.newgrounds.com/portal/view/586108/format/flash?emulate=flash
Edit: Same panic as before with https://www.newgrounds.com/portal/view/615438/format/flash?emulate=flash and https://www.newgrounds.com/portal/view/515778/format/flash?emulate=flash |
Added GIF support (this also fixes #27). Interestingly these all seem to be generated by OpenFL, so maybe you can't generate these using Flash IDE directly after all. |
All gifs successfully parse 👍 |
According to the specs, DefineBitsJPEG2/3 tags can sometimes contain GIF and PNG data. This PR adds the ability to decode PNG data out of these tags.
I'm still not sure how to generate these tags using the Flash IDE, but there are examples in #530. I'm guessing it's some incantation of
[Embed]
, for example,[Embed(source="test.gif")]
. This may depend on the version of the authoring software (this metadata was first added in Flex Builder and didn't make it over to Flash until ~CS5).Added
determine_jpeg_tag_format
anddecode_define_bits_jpeg
helper methods to handle the SWF tags.decode_define_bits_jpeg
will verify the format of the image data and decode it appropriately.GIF is currently unimplemented (we haven't seen a case of this in the wild yet), but a better error will now be returned.