I have absolutely no idea what you are talking about, but attempting to gzip a PNG file is pointless.
In the link “this thread” what is in data please check this below code
this.storage.get('savedSignature').then((data) => {
/*
in data I have that full path so according to that thread this below way I have to send data
*/
let body = JSON.stringify(data);
let gzippedBody = Pako.gzip(body);
let headers = new Headers({ "Content-Encoding" : "gzip"});
headers.append('Content-Type', 'application/json; charset=x-user-defined-binary');
let options = new RequestOptions({ headers: headers });
return this.http.post(url, gzippedBody, options);
});
it is a json that has elements with 1 element being the signature. Something like:
{
name: “John doe”,
signature: “base64/lnsdklndknsklnknklnfknfkn”
}
If you read to the end of the thread you’ll see that I wasn’t able to compress the base64 string just like @rapropos said that I won’t be able to. The solution I’m using now is to compress the signature pad to sort of remove the empty space in the signature canvas after the user clicks on save