[SOLVED] [flash] ByteArray length inconcistency between Assets and URLLoader

I have one png file. I added it to project via <assets type="binary"> . And also I loaded that file by URLLoader. The problem in the length difference between 2 ByteArrays. While URLLoader’s result gives me a correct bytes but Assets gives me wrong.

Lime/OpenFl assets packager do something changes with files? Data size from assets is 256 kBytes (vs raw 27 kbytes from loader). If so, is there a way to tell Lime embed file as is?

Full project is there .

There’s a typo in your project.xml: assets are declared of type="bytes" instead of binary.

That makes openfl infer the type as a png image, and that’s why you get a 256k ByteArray back (== w:256 x h:256 x channels:4). You can see what happens exactly by insepcting the generated DefaultAssetLibrary.hx.

Oh, I just wrote wrong type :sweat_smile: @azrafe7 thanks a lot !