a few words about web development

How to open TGA images in PHP and save as PNG

Working with TGA textures in PHP
In this post we're going to convert TGA images to PNG using REST API. If you want to do this without any API please read this post.

$url = 'http://server.com/image.tga';
$data = json_decode(file_get_contents('http://api.rest7.com/v1/image_convert.php?url=' . $url . '&format=png'));

if (@$data->success !== 1)
$image = file_get_contents($data->file);
file_put_contents('output.png', $image);