문제

We're developing a website and for a particular section user is uploading images. User can upload a jpg file, which on upload we need to convert it to TGA format.

Is there any PHP or CI library which can do this? I know this is not possible with GD library or PHP image magic.

Thanks for any help.

Cheers

도움이 되었습니까?

해결책

You can do that with PHP imagemagick's setImageFormat!

And imagemagick support TGA (Read, Write).

From the comments:

<?php
        $image = new Imagick();

        $image->setResolution(300, 300);
        $image->readImageBlob(...);
        // convert the output to TGA
        $image->setImageFormat('tga');
?>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top