You must pass the mime type when creating the texture for the exporter to use the correct image type:
Note that the exported image size is different from the source image because the data are read from the texture and recompressed. We don’t keep the original source image to avoid consuming too much memory.
In fact, we have the original data because context lost handling is enabled by default (engine.doNotHandleContextLost == false). This is true for any texture (but the data is not always in _buffer). If the context lost handling is disabled, however, no data is available.
So maybe using the original texture data when engine.doNotHandleContextLost == false could be a solution in this case…