| | |
| Stránka: 1 z 1
| [ Príspevok: 1 ] | |
Autor | Správa |
---|
Registrovaný: 26.07.06 Prihlásený: 20.03.16 Príspevky: 1378 Témy: 90 Bydlisko: Slovakia-Ko... | Napísal kmsa: 11.09.2009 18:09 | |
|
Mam taky mensi problem
//s uploadom este tak neviem zaobchadzat a prenasanie obrazkou nieje onic lepsie na tom
mam script na upload a vytvaranie minatury //par veci som nasiel na tomto fore
lenze ja by som potreboval nie presnu miniaturu daneho obrazku ale iba cca stred/lavy horny roh alebo spodny
tj obrazok ma rozmery 2500x1200(px)
ustipne sa 800x800 zo stredu (definuje sa nahodne umiestnenie a rozmer v urcitom rozmedzi) a ta sa zmenis na pozadovany rozmer
tu je prilozeny code //nieje este nic osetrene len to co mam na bindy nastavene
Kód: $tmp_name = $_FILES['nazov']['tmp_name']; $filename = $file_name = $_FILES['nazov']['name']; if (!empty($_POST['sprava']) and @is_uploaded_file($tmp_name) and ereg("jpg|JPG|gif|GIF|png|PNG",$filename)) {
$imginfo_array = getimagesize($tmp_name);
$mime_type = $imginfo_array['mime'];
$result = move_uploaded_file($tmp_name, 'photos/'.$file_name);
$settings["thumbsdir"]="tmb/"; @$dirhandle=opendir('./photos/');
$files[]=$filename; if (!file_exists($settings["thumbsdir"].$filename)) { if (ereg("jpg|JPG",$filename)) $image=imagecreatefromjpeg("photos/".$filename); elseif (ereg("gif|GIF",$filename)) $image=imagecreatefromgif("photos/".$filename); elseif (ereg("png|PNG",$filename)) $image=imagecreatefromjpeg("photos/".$filename); $width=imagesx($image); $height=imagesy($image); $thumbw = 80; $thumbh = 80; $image2=imagecreatetruecolor($thumbw,$thumbh); imagecopyresampled($image2,$image,0,0,0,0,$thumbw,$thumbh,$width,$height); if (ereg("jpg|JPG",$filename)) { imagejpeg($image2,$settings["thumbsdir"].$filename,80); } elseif (ereg("gif|GIF",$filename)) { imagegif($image2,$settings["thumbsdir"].$filename); } elseif (ereg("png|PNG",$filename)) { imagepng($image2,$settings["thumbsdir"].$filename); } }
$sql = "INSERT INTO ps (cesta, datum, sprava) " . "VALUES ('". htmlspecialchars($file_name). "', '". date("Y-m-d H:i:s", time()) ."', '". htmlspecialchars($_POST['sprava']) ."')";
mysql_query($sql, $spojenie) or die('Nepodarilo sa pridat novinku; '. mysql_error()); }
dik za pomoc a myslim ze nic take som na tomto fore nevidel rozoberat (aspon nie v tom zmysle ustipnutia ozbrasku)
_________________ CPU: Intel E7200 momentalne default + freezer 7 pro | MB: Gigabyte GA-P35-DS3 rev. 2.0 F14 | RAM: A-DATA 4x1GB EE Vitesta | VGA: ATI Radeon HD4850 Sapphire Dual Slot | Monitor: BenQ E2200HD+17CTX | HDD: WD 3200AAKS + Maxtor 6Y080M0 80GB SATAII + 120GB ATA Barracuda | PSU: Corsair VX450W | Windows 7 Ultimate Sk | REPRO: Logitech X-210
+
IPhone 3GS JB 3.1.3 (new BR)
múdry sa postara o seba ale ešte múdrejši sa postara aj o druhých |
|
| Stránka: 1 z 1
| [ Príspevok: 1 ] | |
| Nemôžete zakladať nové témy v tomto fóre Nemôžete odpovedať na témy v tomto fóre Nemôžete upravovať svoje príspevky v tomto fóre Nemôžete mazať svoje príspevky v tomto fóre
|
|