1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| <?php
// Create image instances
$image_width = $_POST['img_width'];
$image_height = $_POST['img_height'];
$source_x = $_POST['source_x'];
$source_y = $_POST['source_y'];
$tambour=$_POST['tambour'];
$carac=$_POST['carac'];
$point=$_POST['point'];
$typefib=$_POST['typefib'];
$obj=$_POST['objectif'];
$src = imagecreatefromjpeg('C020R00B-N-x50.jpg');// c'est içi que je veux mettre le nom de l'image selectionnée dans l'autre page
$dest = imagecreatetruecolor($image_width, $image_height);
// Copy
imagecopy($dest, $src, 0, 0, $source_x, $source_y, $image_width, $image_height);
// Output and free from memory
header('Content-Type: image/jpeg');
$nom_image=$tambour.$carac.$point.'-'.$typefib.'-'.$obj;
// Save the two images created
$nom = "image_traitee"; // Le nom du répertoire à créer
// vérifie si le répertoire existe :
if (!is_dir($nom)) {
mkdir($nom);
}
imagejpeg($dest,"./".$nom."/".$nom_image.".jpg" );
imagejpeg($dest);
// Libération de la mémoire associée à l'image
imagedestroy($dest);
imagedestroy($src); |
Partager