@miguellara78 wrote:
So,
I was trying to find a way to zip and encode an image into base64 string.
I already figured out how to encode the image into a base64 string, but I can't find a way to compress it.
I was assuming that there would be a tool that could help me in the ZipUtils library, but I am not sure.I am basically trying to do the oposite of what the following piece of code does in the Cocos2d-x source files:
int decodeLen = base64Decode((unsigned char*)textureData.c_str(), (unsigned int)dataLen, &buffer); CCASSERT( buffer != nullptr, "CCParticleSystem: error decoding textureImageData"); CC_BREAK_IF(!buffer); ssize_t deflatedLen = ZipUtils::inflateMemory(buffer, decodeLen, &deflated); CCASSERT( deflated != nullptr, "CCParticleSystem: error ungzipping textureImageData"); CC_BREAK_IF(!deflated);
Posts: 2
Participants: 1