Soshot/app/Utils/ConvertToPng.php

18 lines
361 B
PHP
Raw Permalink Normal View History

2023-06-21 11:42:36 +02:00
<?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);
}
}