Hi guys

Scenario

I read the icon file using php, after I have all the information of icon file e.g. width, height, bitx/pixel, total_colors, image data etc. And now I want to write that icon data (actual image from icon) as jpg file.

Question
How will I write the image I already have in binary form to jpeg file ?

Any help is highly appreciated.

regards