Well dumpswf kind of makes a similar output to the above in header form, but it makes the zlibdata purely as a jpegstream.
The code I have listed above is trying to create a SWF from PNG. I'm not trying to go the other way.
Besides, if you look at the code, there are commands present that dumpswf wouldnt use, like filename=> and pngdatatable