@@ -843,21 +843,7 @@ function exportTo($saveTo, $format = 'png', $extraEncodeParam = '') {
843
843
unset($ bmp );
844
844
$ transcodeFile = 'output.bmp ' ;
845
845
} else if ($ this ->outputMethod == 'pvr ' ) {
846
- /*fclose(fopen('output.pvr','wb'));
847
- $pvr = new FileStream('output.pvr');
848
- $pvr->write(hex2bin('5056520300000000'));
849
- $pvr->write(pack('P', [
850
- TextureFormat::PVRTC_RGB2 => 0,
851
- TextureFormat::PVRTC_RGB4 => 2,
852
- TextureFormat::PVRTC_RGBA2 => 1,
853
- TextureFormat::PVRTC_RGBA4 => 3,
854
- ][$this->textureFormat]));
855
- $pvr->write(hex2bin('0000000000000000'));
856
- $pvr->write(pack('V', $this->height));
857
- $pvr->write(pack('V', $this->width));
858
- $pvr->write(hex2bin('0100000001000000010000000100000000000000'));
859
- $pvr->write($this->imageData);
860
- unset($pvr);*/
846
+ // https://github.com/esterTion/pvrtc-decompress/
861
847
file_put_contents ('output.pvr ' , $ this ->imageData );
862
848
exec ('pvr-decompress output.pvr output.bmp ' .implode (' ' , [$ this ->width , $ this ->height , [
863
849
TextureFormat::PVRTC_RGB2 => 1 ,
0 commit comments