<?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);
    }
}
