18 lines
361 B
PHP
18 lines
361 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Utils;
|
||
|
|
||
|
class ConvertToPng {
|
||
|
|
||
|
static function convertToPng($demande) {
|
||
|
|
||
|
rename($demande->requestImg, $demande->requestImg . '.tmp');
|
||
|
$tmpFile = $demande->requestImg . '.tmp';
|
||
|
|
||
|
|
||
|
if (!imagepng(imagecreatefromstring(file_get_contents($tmpFile)), $demande->requestImg)) {
|
||
|
}
|
||
|
unlink($tmpFile);
|
||
|
}
|
||
|
}
|