I have an FBX with embedded image content. The image is in Base64. I read the chunk and decode it successfully. The problem comes when the image is bigger. The FBX splits the image into 2 lines which seems like base64, but I don't get how should I decode it.
- I tried decoding both lines in base64 and concatenating them before decompressing the png, but the png is corrupted.
- I tried concatenating the Base64 strings but it does not work, as the ending = trail is wrong this way.
- I tried to decompress first the first line ( a correct png but only half of the image) and decompress the second one as a bitmap, but as the second one does not have the headers is an invalid image.
Content: , "iVBORw0KGgoAAAANSUhEUg...AAAAA=", "AAAAAAAAAAAAAAAAAA...AD//wEAAP///noceab5flIAAAAASUVORK5CYII="
As you can see, the first line is the PNG header (iVBOR...) but the second line does not have a header. The first line and the second one has base64 ending, so I suspect they should be decoded separately.
Does somebody know how to?
How to replicate: open 3ds max create a plane, apply image as texture, save as ascii FBX with embed media.