par
phpdog » 30 sept. 2008, 15:23
Bonjour, j'ai fait un code pour redimentionner une image:
$vrTailleIMG = GetImageSize ($vrFichier);
$vrLargIMG = "$vrTailleIMG[0]";
$vrHautIMG = "$vrTailleIMG[1]";
if ($vrLargIMG > $vrHautIMG)
{
$largeurDestination = 640;
$hauteurDestination = 480;
ImageCopyResampled($vrIMGdestination, $vrFichier, 0, 0, 0, 0, $largeurDestination, $hauteurDestination, $vrLargIMG, $vrHautIMG);
//ImageString($vrIMGdestination, 0, 12, $hauteurDestination, "$vrFichier - ($vrLargIMG x $vrHautIMG)", $blanc);
//imagecopyresized ( $vrIMGdestination , $vrFichier , 0 , 0 ,0 , 0 , $largeurDestination , $hauteurDestination , $vrLargIMG , $vrHautIMG );
} else {
echo "image verticale";
}
Mais j'ai le'rreur suivante:
Warning</b>: imagecopyresampled(): supplied argument is not a valid Image resource
Que dois-je faire ?
Bonjour, j'ai fait un code pour redimentionner une image:
[php]$vrTailleIMG = GetImageSize ($vrFichier);
$vrLargIMG = "$vrTailleIMG[0]";
$vrHautIMG = "$vrTailleIMG[1]";
if ($vrLargIMG > $vrHautIMG)
{
$largeurDestination = 640;
$hauteurDestination = 480;
ImageCopyResampled($vrIMGdestination, $vrFichier, 0, 0, 0, 0, $largeurDestination, $hauteurDestination, $vrLargIMG, $vrHautIMG);
//ImageString($vrIMGdestination, 0, 12, $hauteurDestination, "$vrFichier - ($vrLargIMG x $vrHautIMG)", $blanc);
//imagecopyresized ( $vrIMGdestination , $vrFichier , 0 , 0 ,0 , 0 , $largeurDestination , $hauteurDestination , $vrLargIMG , $vrHautIMG );
} else {
echo "image verticale";
}[/php]
Mais j'ai le'rreur suivante:
[quote]Warning</b>: imagecopyresampled(): supplied argument is not a valid Image resource[/quote]
Que dois-je faire ?