<?php

$type='spline';
if (isset($_REQUEST['type'])) $type=$_REQUEST['type'];

$files = glob('/opt/TOPISTO/data/'.$type.'/*.png');
usort($files, function($a, $b) {
    return filemtime($a) > filemtime($b);
});

$block_image = @imagecreatefrompng($files[0]);

// ---
// --- envoyer l'image au navigateur
// ---
header("Content-Type: image/png");
imagepng($block_image);

imagedestroy($block_image);

?>
