Resize et Copy image

Fermé
piep14 Messages postés 229 Date d'inscription mercredi 30 décembre 2009 Statut Membre Dernière intervention 19 décembre 2013 - 8 mai 2010 à 13:42
Bonjour, je cherche a copier une image distante sur mon ftp avant la redimensionnant
J'ai fait ceci:

<?php
// Le fichier
$filename = 'http://williamcalvin.com/portraits/bonobo/2005SDZ%20143adj.jpg';

// Définition de la largeur et de la hauteur maximale
$width = 150;
$height = 150;

// Content type
header('Content-type: image/jpeg');

// Cacul des nouvelles dimensions
list($width_orig, $height_orig) = getimagesize($filename);

$ratio_orig = $width_orig/$height_orig;

if ($width/$height > $ratio_orig) {
   $width = $height*$ratio_orig;
} else {
   $height = $width/$ratio_orig;
}

// Redimensionnement
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Affichage
imagejpeg($image_p, null, 100);
if(!copy($image,'./vincent.jpg')) {echo 'PB';} else {echo 'OK';}
?>

Mais je ne vois rien sur mon ftp.
Voyez vous le problème ?
Merci