Gzinflate on a string that has been base_64 encoded in Windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings!

I have a long piece of string that is apparently a PNG image which has been
base_64 decoded in an XML file. I can retreive this string without problem.
The string is in $mystra

$pngdata = base64_decode($mystra);
$pngdata = gzinflate($pngdata);

When i try to gzinflate it , i get a warning that says "data error" and if i
write pngdata to a binary file using fopen, there is 0 bytes (because of the
warning).

If i just write the base_64 decoded data to a binary file, then I can't open
the file as a gziped file. (it is not a valid gzip'ed file)

From the person who sent me the XML file, what I was told

the base_64 decoded data will give me the deflated binary array for the
image, which I would need to inflate using an InflaterInputStream, and as a
result, I will get the PNG file that is represented in $mystra.

I probably need to add some PNG headers to it and/or explode the base_64
decoded data and then add headers to it.

I am getting quite lost here. Can anyone provide some hints please?

Regards


Venky

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux