Por muchas pruebas que hago. No se donde cometo el error para pasar la variable a la funcion.
    Código PHP:
    <?php
 
function Tamany_petit($filename) {
    $percent = 0.25;
    
    // Content-type para el navegador
    header('Content-type: image/jpeg');
 
    // Se obtienen las nuevas dimensiones
    list($width, $height) = getimagesize($filename);
    $newwidth = $width * $percent;
    $newheight = $height * $percent;
 
    // Cargar la imagen
    $thumb = imagecreate($newwidth, $newheight);
    $source = imagecreatefromjpeg($filename);
 
    // Redimensionar
    imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
 
    // Mostrar la nueva imagen
    imagejpeg($thumb);
    imagedestroy($thumb);
}
 
$IDSORTIDA = 'grafiques/images/' . '060226AA'. '.jpg';
 
echo "<a href=\" " . $IDSORTIDA . "\"><img src='Tamany_petit(\"$IDSORTIDA\")' border=\"0\"></a></td>";
 
?>