codice:
$imgname= 'test.jpg';
$dim = getimagesize( $imgname );
$new_width = 400;
$new_height = ceil( $dim[1] / $dim[0] * $new_width );
$src_img = imagecreatefromjpeg( $imgname );
$new_img = Imagecreatetruecolor( $new_width, $new_height );
imagecopyresampled( $new_img, $src_img, 0, 0, 0, 0,$new_width, $new_height, $dim[0], $dim[1] );
$colore = imagecolorallocate( $new_img, 255, 255, 255 );
// dimensione in pixel dell'angolo curvo
$dim_angolo = 10;
for ( $i = 0; $i <= $dim_angolo; $i++ ){
$y = $dim_angolo - ceil( sqrt( 2 * $dim_angolo * $i - pow( $i, 2 ) ) );
$x = $i;
imageline( $new_img, $x, 0, $x, $y, $colore );
$y2 = $new_height - $y;
imageline( $new_img, $x, $y2, $x, $new_height, $colore );
$x = $new_width - $i;
imageline( $new_img, $x, 0, $x, $y, $colore );
imageline( $new_img, $x, $y2, $x, $new_height, $colore );
}
header( 'content-type: image/jpeg' );
imagejpeg( $new_img, '', 80 );
imagedestroy( $new_img );
imagedestroy( $src_img );
p.s.: una soluzione più leggera per il server sarebbe quella di preparare delle gif trasparenti da sovrapporre all'immagine, dopo averle opportunamente ridimensionate e ruotate.