How to open TGA images in PHP and save as PNG
Working with TGA textures in PHP

<?php
$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)
{
die('Failed');
}
$image = file_get_contents($data->file);
file_put_contents('output.png', $image);
Comments