Ja potrebujem ten obrazok hned aj upravit. Napr. prvy obrazok o rozmere 800px mi urobil a pri druhom to už spadlo. Ale niekedy to urobí aj ten druhý.

Script:

Kód:
<form action="index.php" method="post" enctype="multipart/form-data">
Leták 1 <input type=file name=obr>
<input type=submit value=Odoslať>
</form>
Kód:
$mobr="pic1.jpg";
    $mobr_big="pic1_big.jpg";
    $cesta="../market"
$width=800;
$width=1024;
    
    $rozmer=GetImageSize&#40;$obr&#41;;
 
    $w1=$rozmer&#91;0&#93;/100;
    $w2=$width/$w1;
    $height=$rozmer&#91;1&#93;/100*$w2;  
    
    $w2_big=$width_big/$w1;
    $height_big=$rozmer&#91;1&#93;/100*$w2_big;
       
    $in=ImageCreateFromJpeg&#40;$obr&#41;;
        
    if&#40;$rozmer&#91;0&#93;>$width&#41;&#58;
    $out=ImageCreateTruecolor&#40;$width,$height&#41;;
    ImageCopyResampled&#40;$out,$in,0,0,0,0,$width,$height,$rozmer&#91;0&#93;,$rozmer&#91;1&#93;&#41;;
    ImageJpeg&#40;$out,"$cesta/$mobr",80&#41;&#41;&#58;
        
	  ImageDestroy&#40;$out&#41;;
	  endif;
	  
	  if&#40;$rozmer&#91;0&#93;>$width_big&#41;&#58;
    $out_big=ImageCreateTruecolor&#40;$width_big,$height_big&#41;;
    ImageCopyResampled&#40;$out_big,$in,0,0,0,0,$width_big,$height_big,$rozmer&#91;0&#93;,$rozmer&#91;1&#93;&#41;;
    ImageJpeg&#40;$out_big,"$cesta/$mobr_big",80&#41;;
      
    ImageDestroy&#40;$out_big&#41;;
    endif;
    	 
    ImageDestroy&#40;$in&#41;;

Edit: Niekedy mi v iných scriptoch robí problém pri veľkých súboroch aj funkcia copy(), preto som to tu spomenul.
Momentálne mi ide všal o tento script.
Zdá sa že samotný upload je v poriadku, problém je pri ImageCreateTruecolor a pokiaľ sa jedná o veľký obrázok.