Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17080

ZipUtils::inflateMemory Looking for the opposite

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 17080

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>