Autor Zpráva
anonym
Profil *
Mam script:

<?php

function make_thumb ($img_src, $img_th)
{
// some configuration, please match to your server settings
$gd_version = 2;
$thumb_on = 'x';
$thumb_size = 100;
$quality = 30;

$img_size = GetImageSize ($img_src);
$img_in = ImageCreateFromJPEG ($img_src);

if ($thumb_on == 'y')
{
$img_x = ($thumb_size/$img_size[1]) * $img_size[0];
$img_y = $thumb_size;
}
else
{
$img_y = ($thumb_size/$img_size[0]) * $img_size[1];
$img_x = $thumb_size;
}

if ($gd_version == '1')
{
$img_out = ImageCreate($img_x, $img_y);
ImageCopyResized ($img_out, $img_in, 0, 0, 0, 0, $img_x, $img_y, $img_size[0], $img_size[1]);
}
elseif ($gd_version == '2')
{
$img_out = ImageCreateTrueColor($img_x, $img_y);
ImageCopyResampled ($img_out, $img_in, 0, 0, 0, 0, $img_x, $img_y, $img_size[0], $img_size[1]);
}

ImageJPEG ($img_out, $img_th, $quality);
ImageDestroy ($img_out);
ImageDestroy ($img_in);
}


if (isset ($_FILES['image']['name']))
{
$fn = $_FILES['image']['name'];
$src = 'images/'.$fn;
$th = 'thumbs/'.$fn;
if (!@move_uploaded_file ($_FILES['image']['tmp_name'], $src)) die ('Can not upload file...');

make_thumb ($src, $th);
echo "Done!<BR>Original Image:<img src="$src"><BR>Thumbnail Image:<img src="$th">";
}
?>

<form enctype="multipart/form-data" action="thumb.php" method="post">
Thumbnail this file: <input name="image" type="file">
<input type="submit" value="Send File">
</form>


chci tam přidat ještě dva inputy, ale jak pak upravit script aby udelal nahledy ze vsech zaroven?
Alphard
Profil
cyklem,
viz http://cz.php.net/manual/cs/features.file-upload.multiple.php
anonym
Profil *
a jak by to melo vypadat konkretne pro vyse uvadeny script? Vcera jsem cosi zmastil, ale hazalo to jeden error za druhym tak sem to radeji smazal ...
anonym
Profil *
Prosímm
anonym
Profil *
moc prosím
T2001
Profil *
preci nechces aby to za tebe nekdo prepsal ... leda by se tadle diskuze mela jmenovat
"Mam penize a potrebuju napsat script, kerej mi udela to a to .... " zn. dobře zaplatím

pak by to bylo bezproblemu :-)
krteczek
Profil
T2001: ;-)
anonym
Profil *
a kolik si za to predstavujes?
25k
Profil *
www.irfanview.cz

zmensi si to sam ;-)
Toto téma je uzamčeno. Odpověď nelze zaslat.

0