Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
874 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  Help... Script d'image qui ne passe pas sur mon new hébergeur

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Help... Script d'image qui ne passe pas sur mon new hébergeur

n°1155640
Dawa
www.shootmeagain.com
Posté le 21-07-2005 à 10:52:42  profilanswer
 

Bonjour !
 
 
Je suis passé ce matin chez un nouvel hébergeur, Nexlink.
 
Pour mon site j'ai plusieurs scripts qui permettent de redimensionner automatiquement une image qu'on vient d'uploader... Je vous copie le script ici.
 
 

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


 
 
Et voici le message d'erreur :
 
 

Citation :


 
 
Warning: fopen(team/erikBIG.jpg) [function.fopen]: failed to open stream: Permission denied in /mnt/sites/shootmeagain.com/web/thumb.php on line 55
 
Warning: fclose(): supplied argument is not a valid stream resource in /mnt/sites/shootmeagain.com/web/thumb.php on line 56
 
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'team/erikBIG.jpg' for writing in /mnt/sites/shootmeagain.com/web/thumb.php on line 59
 
Warning: fopen(team/erik.jpg) [function.fopen]: failed to open stream: Permission denied in /mnt/sites/shootmeagain.com/web/thumb.php on line 55
 
Warning: fclose(): supplied argument is not a valid stream resource in /mnt/sites/shootmeagain.com/web/thumb.php on line 56
 
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'team/erik.jpg' for writing in /mnt/sites/shootmeagain.com/web/thumb.php on line 59
Redirection en cours !
 


 
 
Ce script marche parfaitement en local et sur mon ancien hébergeur... Mais j'avais déjà eu le meme probleme l'an dernier en prenant un hébergement chez Planet-Work, et ils ont été incapables de m'aider, du coup j'ai payé un hébergement pour rien... Mais cette fois c'est 105€, j'aimerais qd meme que ca marche :/


---------------
SHOOT ME AGAIN WEBZINE
mood
Publicité
Posté le 21-07-2005 à 10:52:42  profilanswer
 

n°1155662
FlorentG
Unité de Masse
Posté le 21-07-2005 à 11:06:54  profilanswer
 

Revois les permissions de tes dossier alors, non ?

n°1155713
Dawa
www.shootmeagain.com
Posté le 21-07-2005 à 11:24:38  profilanswer
 

Les dossiers concernés sont déjà tous en 755 :/


---------------
SHOOT ME AGAIN WEBZINE
n°1155718
Dawa
www.shootmeagain.com
Posté le 21-07-2005 à 11:27:09  profilanswer
 

ahahah 755 c'etait ptetre pas suffisant :o


---------------
SHOOT ME AGAIN WEBZINE
n°1155719
zapan666
Tout est relatif
Posté le 21-07-2005 à 11:27:19  profilanswer
 

Dawa a écrit :

Les dossiers concernés sont déjà tous en 755 :/


& les fichiers ? car si tu réécris dessus, ils doivent être en +w


---------------
my flick r - Just Tab it !
n°1155814
Dawa
www.shootmeagain.com
Posté le 21-07-2005 à 12:00:10  profilanswer
 

ah ouais c'est juste ca, jsuis rassuré, ouf ! :o  
 
mais là dans mes répertoires j'ai des trucs du style
 
/photos/1/
/photos/1/small/
/photos/2/
/photos/2/small/
/photos/3/
/photos/3/small/
 
Et ca va jusque 500, donc pour les small y a moyen de modifier tous les chmod avec un bete script j'espere :D


---------------
SHOOT ME AGAIN WEBZINE
n°1155819
zapan666
Tout est relatif
Posté le 21-07-2005 à 12:02:49  profilanswer
 

ouais, déjà fais, mais sous unix (et donc pas via FTP...)
Sinon, dans ton script php, tu peux faire un chmod juste avant d'écrire sur ton image


---------------
my flick r - Just Tab it !
n°1155891
Dawa
www.shootmeagain.com
Posté le 21-07-2005 à 12:31:09  profilanswer
 

bon j'avais fait un ptit script facile, mais  
 
Warning: chmod() [function.chmod]: Operation not permitted in /mnt/sites/shootmeagain.com/web/index.php on line 247
photos/1/small
 
ca veut dire que jvais devoir tout faire a la main? :D


---------------
SHOOT ME AGAIN WEBZINE
n°1155918
Dawa
www.shootmeagain.com
Posté le 21-07-2005 à 12:42:28  profilanswer
 

existe-t-il un client FTP qui permette de modifier les chmod d'un dossier et de tous les sous-dossiers dedans ? :??:  
 
merci


---------------
SHOOT ME AGAIN WEBZINE

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  Help... Script d'image qui ne passe pas sur mon new hébergeur

 

Sujets relatifs
recherche un script de recuperageLancer un script en tache de fond
[ resolu - sql help ] requete sql not inAfficher une image locale dans un fomulaire HTML
[GD] Rendre une image transparente + ajout d'un rectangle.[HELP] select/option/ et onClick/onBlur...
[PHP] reduire le poids d'une image.galeris image
recherche d'un script[java] afficher une image avec SWT
Plus de sujets relatifs à : Help... Script d'image qui ne passe pas sur mon new hébergeur


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR