FORUM Tom's Hardware » Programmation » PHP & MySQL & ASP » [PHP] Script de traitement d'images qui marche en local et pas online
 

[PHP] Script de traitement d'images qui marche en local et pas online

Il y a 290 utilisateurs connus et inconnus. Pour voir la liste des connectés connus, cliquez ici
Ajouter une réponse



 Mot :   Pseudo :  
 
Bas de page
Auteur
 Sujet : [PHP] Script de traitement d'images qui marche en local et pas online
 
4,8,15,16,23,42
Plus d'informations

Bonjour !
 
Je viens de tester pour la énième fois mon script de redimensionnement d'images. Il marche très bien maintenant, que ce soit en local ou sur un compte free mais malheureusement chez mon hébergeur(Planet-Work, www.planet-work.com ) ca ne passe toujours pas, je n'ai pas de message d'erreur mais il reste bloqué sur l'écran du formulaire...
 
j'ai bien vérifié les chmod des dossiers concernés et ils ont tous suffisamment d'autorisations... (et meme trop mais bon c'est pour tester...)
 
 
voici les scripts en question :
 

Code :
  1. if(is_uploaded_file ($_FILES[$nomtof]['tmp_name']))
  2.     {
  3.         $tof=$_FILES[$nomtof]['tmp_name'];
  4.         $newname=$_FILES[$nomtof]['name'];
  5.         $newname = rawurldecode($newname);
  6.         $newname=strtolower($newname);
  7.         $resized=resize($tof,$newname,800,700,"./pics/" );
  8.         $thumb=resize($tof,$newname,130,130, "./pics/small/" );
  9.         MAJtof($_POST['mode'], $_POST, $bd, $newname);
  10.         $ok=1;
  11.     }


 
 
et la fonction resize utilisée :
 

Code :
  1. function resize($file, $tofname, $maxWidth, $maxHeight, $path)
  2.   {
  3.     $prod=$maxWidth*$maxHeight;
  4.      //Créé une image à partir de $file
  5.       $img = ImageCreateFromJpeg($file);
  6.      //Dimensions de l'image
  7.      $imgWidth = imagesx($img);
  8.      $imgHeight = imagesy($img);
  9.      //Facteur largeur/hauteur des dimensions max
  10.      $whFact = $maxWidth/$maxHeight;
  11.      //Facteur largeur/hauteur de l'original
  12.      $imgWhFact = $imgWidth/$imgHeight;
  13.      //fixe les dimensions du thumb
  14.      if($imgWidth <= $maxWidth && $imgHeight <= $maxHeight)
  15.      {
  16.          $thumbWidth=$imgWidth;
  17.          $thumbHeight=$imgHeight;
  18. }
  19. else
  20. {     
  21.          if($imgWidth > $imgHeight)
  22.          {
  23.             //Si largeur déterminante
  24.             $thumbWidth  = $maxWidth;
  25.             $thumbHeight = $thumbWidth/$imgWhFact;
  26.            }
  27.            else
  28.            {
  29.             //Si hauteur déterminante
  30.             $thumbHeight = $maxHeight;
  31.             $thumbWidth = $thumbHeight*$imgWhFact;
  32.         }
  33.     }
  34.      //Créé le thumb (image réduite)
  35.      $imgThumb = ImageCreateTruecolor($thumbWidth, $thumbHeight);
  36.      //Insère l'image de base redimensionnée
  37.      ImageCopyResampled($imgThumb, $img, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imgWidth, $imgHeight);
  38.      //Nom du fichier thumb
  39.      list($titretof,$ext,$temp) = explode(".",$file);
  40.      $imgThumbName = $path.$tofname;
  41.      //Créé le fichier thumb
  42.      $fp = fopen($imgThumbName, "w" );
  43.      fclose($fp);
  44.      //Renvoie le thumb créé
  45.      ImageJpeg($imgThumb, $imgThumbName, 90);
  46.      return $imgThumbName;
  47.   }


 
 
Qqun voit ce qui pourrait coincer?  :??:  
 
Merci !


---------------
Un webzine de qualité | SHOOT ME AGAIN | pour autant que vous ayez de bons goûts !
MY FUCKIN'PORTFOLIO --> HS by now...
Je dois moi-même décharger moi-même des palet

Help us take back the web!
Plus d'informations

t'a quoi comme erreur ?


---------------
Firefox 1.0 ! Get FireFox et pour les francophones : Firefox en français
 

 

Profil : Pointeur
Plus d'informations

ca doit etre une erreur de gdlib pas installée [:spamafote]


---------------
Da Bidz Triad©®™: Bidz Interceptor
.:: Smileyz version 4.2 [050625]::. -- Code source disponible sous licence GPL.
[u
Help us take back the web!
Plus d'informations

KangOl a écrit :

ca doit etre une erreur de gdlib pas installée [:spamafote]

oui surement

4,8,15,16,23,42
Plus d'informations

http://www.shootmeagain.com/phpinfo.php
 
GD Support  enabled  
GD Version  bundled (2.0.23 compatible)  
 
 
apparemment c'est censé marcher? :/


---------------
Un webzine de qualité | SHOOT ME AGAIN | pour autant que vous ayez de bons goûts !
MY FUCKIN'PORTFOLIO --> HS by now...
Je dois moi-même décharger moi-même des palet
Profil : Pointeur
Plus d'informations

en tous cas, il y a des efforts a faire pour que ce soit compatible avec firefox :o


---------------
Da Bidz Triad©®™: Bidz Interceptor
.:: Smileyz version 4.2 [050625]::. -- Code source disponible sous licence GPL.
[u
4,8,15,16,23,42
Plus d'informations

ah oué tiens :o  
 
jsuis en train d'améliorer ca :o


---------------
Un webzine de qualité | SHOOT ME AGAIN | pour autant que vous ayez de bons goûts !
MY FUCKIN'PORTFOLIO --> HS by now...
Je dois moi-même décharger moi-même des palet

Aller à :
Ajouter une réponse
  FORUM Tom's Hardware » Programmation » PHP & MySQL & ASP » [PHP] Script de traitement d'images qui marche en local et pas online
 

Annonces Google
Publicité