Puoi fare cosi
Codice PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
Immagine ridimensionata<br/>
<img src="test363.php?url=http://www.emmella.fr/collection/SHARP_PC_1500A_001.jpg" alt="">
<br/>
Immagine normale<br/>
<img src="http://www.emmella.fr/collection/SHARP_PC_1500A_001.jpg" alt="">
</body>
</html>
File test363.php
Esempio preso dalla documentazione di php.
Attenzione : Nel file non deve esserci alcun carattere prima di <?php
Codice PHP:
<?php
// Le fichier
$filename = $_GET['url'];
$percent = 0.5;
// Content type
header('Content-Type: image/jpeg');
// Calcul des nouvelles dimensions
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = $height * $percent;
// Redimensionnement
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Affichage
imagejpeg($image_p, null, 100);
?>