IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Pas d'image miniature message "Warning


Sujet :

Langage PHP

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2012
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 16
    Points : 11
    Points
    11
    Par défaut Pas d'image miniature message "Warning
    Bonjour,

    Si une âme charitable veut bien me donner une aide, je débute et j'ai chercher sur google ect..rien trouver et je m'en remet à vous ! voila j'ai télécharger une script petite annonce mais je n'ai pas d'image j'ai le message, je vous joint le fichier php plus bas nommer miniature.php, je ne sais pas comment résoudre cette erreur c'est un problème de chemin d'image je suppose ect...Merci de votre aide si vous avez du temps !

    Salutations

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /home/monpac/public_html/destock.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php on line 5
     
    Warning: Cannot modify header information - headers already sent by (output started at /home/monpac/public_html/destock.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php:5) in /home/monpac/public_html/destock.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php on line 24
     
    Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /home/monpac/public_html/destock.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php on line 25
     
    Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/monpac/public_html/destock.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php on line 43
     
    Warning: imagesx(): supplied argument is not a valid Image resource in /home/monpac/public_html/destock.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php on line 44
     
    Warning: imagesy(): supplied argument is not a valid Image resource in /home/monpac/public_html/destock.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php on line 44
     
    Warning: imagesx(): supplied argument is not a valid Image resource in /home/monpac/public_html/destock.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php on line 44
     
    Warning: imagesy(): supplied argument is not a valid Image resource in /home/monpac/public_html/destock.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php on line 44
     
    Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/monpac/public_html/destock.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php on line 44
     
    Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/monpac/public_html/destock/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php on line 45

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    <?php
     
    error_reporting(E_ALL ^ E_NOTICE);
     
    /// A definir dans l'url d'appel : url complete de l'image ainsi que $w_max et $h_max
     
    $taille = getimagesize("$pic"); 
    $h_i = $taille[1]; 
    $w_i = $taille[0]; 
    	if($h_i >$h_max) 
    	{ 
    	$convert=$h_max/$h_i; 
    	$h_i=$h_max; 
    	$w_i=ceil($w_i*$convert); 
    	} 
    	if($w_i >$w_max) 
    	{ 
    	$convert=$w_max/$w_i; 
    	$w_i=$w_max; 
    	$h_i=ceil($h_i*$convert); 
    	} ; 
     
    $largeur = "$w_i";
    $hauteur ="$h_i";
     
    header("Content-Type: image/jpeg");
    list($width, $height, $type, $attr) = getimagesize("$pic");
     
    if($type == "1")
    {
    $img_in = imagecreatefromgif($pic);
    }
     
    if($type == "2")
    {
    $img_in = imagecreatefromjpeg($pic);
    }
     
    if($type == "3")
    {
    $img_in = imagecreatefrompng($pic);
    }
     
     
    $img_out = imagecreatetruecolor($largeur, $hauteur);
    imagecopyresampled($img_out, $img_in, 0, 0, 0, 0, imagesx($img_out), imagesy($img_out), imagesx($img_in), imagesy($img_in));
    $t = imagejpeg($img_out);
    echo $t;
     
    ?>

  2. #2
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 727
    Points
    10 727
    Par défaut
    $pic n'existe pas

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2012
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 16
    Points : 11
    Points
    11
    Par défaut
    sur le site de l'auteur il ya une demo j'ai bien analyser les minatures avec firebug
    il indique le $pic dans la miniature et dans le fichier minature.php la variable $pic est bien présente l'url de la demo http://www.script-php-petite-annonce...-Calais&page=1

    en copiant l'adresse de l'image d'une miniature avec clic droit sur la demo j'ai
    ww.script-php-petite-annonce.com/demo/region/Nord-Pas-de-Calais/voiture/miniature.php?pic=image-uploade/22-05-2012-19-07-22-M5-00.jpg&w_max=80&h_max=60

    j'ai enregistrer une annonce dans ma demo et en copiant l'adresse de l'image d'une miniature qui ne s'affiche pas sur le script de petite annonce j'ai
    ww.destocknett.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php?pic=image-uploade/16-07-2012-23-16-05-archos2.jpg&w_max=80&h_max=60

    le pic est toujours présent j'y comprend rien du tout

    avec firebug sur le site de l'auteur

    http://www.imagup.com/data/1157229875.html


    et sur ma demo j'ai la même chose
    http://www.imagup.com/data/1157230073.html


    et pour l'installation l'auteur préconise

    Php5, file_uploads, magic_quotes_gpc, sendmail_from : me@localhost.com, date, librairie gd : tout cela doit être sur on ou enabled

    -pour moi php 5 ok
    -file_upload, activer mais je ne sais pas si je dois l'inclure dans le php.ini j'ai mi file_uploads = On
    -magic_quotes_gpc dans le php.ini j'ai mi php_value magic_quotes_gpc 1
    -librairie gd activer par défaut

  4. #4
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 727
    Points
    10 727
    Par défaut
    le code est complètement obsolete,
    http://www.php.net/manual/fr/languag...s.external.php

    et c'est


  5. #5
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2012
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 16
    Points : 11
    Points
    11
    Par défaut
    merci pour cette piste je l'ai appliquer sur le fichier minature.php mais toujours aucun changement les images ne sont pas trouvées, j'ai appliquer des droits en 777 sur le fichier upload même constat

  6. #6
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 727
    Points
    10 727
    Par défaut
    c'est avec $_GET qu'on récupère la variable

  7. #7
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2012
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 16
    Points : 11
    Points
    11
    Par défaut
    Dans le fichier nommer upload-file.php il ya bien la variable $_GET

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    <?php
     
    $repdossier = $_GET['repdossier'];
     
    $uploaddir = 'upload/'.$repdossier.'/';
     
    $file = $uploaddir . basename($_FILES['uploadfile']['name']); 
     
    $dir2 = opendir("upload/$repdossier/");
     
    $getpages=0;
     
    while ($File = readdir($dir2)){
                                    if($File != "." && $File != ".." && $File != "" )
                                      { $getpages++;
     
                                      }
     
    				  }
     
    closedir($dir2);
     
    $calcul = $getpages;
     
    if( @is_file($file) )
    {
    echo "error2";
    }
    else
     
    {
     
    if( $calcul >= 5)
    {
    echo "error1";
    }
     
    else
     
    {
     
     
     
    if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $file)) { 
      echo "success"; 
    } else {
    	echo "error";
    }
    }
     
     
     
    }
     
    ?>

  8. #8
    Expert éminent sénior

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Points : 10 727
    Points
    10 727
    Par défaut
    sans doute mais mais y'a pas de $_GET['pic'], l'erreur est la

  9. #9
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2012
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 16
    Points : 11
    Points
    11
    Par défaut
    je viens d'ajouter le $_GET['pic'] en début dans le fichier upload-file.php toujours même constat, il n'y a pas la variable $pic dans le fichier miniature.php ?
    Petite precision ligne que j'avais oublier de coller dans le post plus bas dans le rapport d'erreur j'ai bien

    Notice: Undefined variable: pic in "Donc la variable pic n'est pas défini" /home/monpac/public_html/destock.com/demopetiteannonce/region/Rhone-Alpes/photo-video/miniature.php on line 5

  10. #10
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2012
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 16
    Points : 11
    Points
    11
    Par défaut
    d'après le raport d'érreurs il manque dans le fichier minature.php

    Undefined variable: h_max en ligne 8
    Undefined variable: w_max en ligne 14
    Undefined variable: pic in en ligne 25
    Undefined variable: img_in in en ligne 44

    je ne sais pas comment m'y prendre !

    Ps: en ligne 4 le commentaire indique
    /// A definir dans l'url d'appel : url complete de l'image ainsi que $w_max et $h_max

    Faudrait il indiqué une url du dossier image suivi de $w_max et $h_max ?

  11. #11
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Août 2012
    Messages
    1
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2012
    Messages : 1
    Points : 1
    Points
    1
    Par défaut même pb
    bonjour avez vous trouvé une solution depuis votre dernier post ? merci beaucoup

Discussions similaires

  1. Message: Security Warning
    Par ENIT-Info dans le forum Access
    Réponses: 7
    Dernier message: 31/01/2006, 21h16
  2. [GD] recherche fonction de création d'images miniatures
    Par digger dans le forum Bibliothèques et frameworks
    Réponses: 3
    Dernier message: 18/11/2005, 21h12
  3. [images miniatures]
    Par jean-jacques varvenne dans le forum Calcul scientifique
    Réponses: 1
    Dernier message: 19/08/2005, 20h33
  4. Réponses: 2
    Dernier message: 04/08/2005, 11h32
  5. [ImageMagick] Images miniatures
    Par oli2a dans le forum Bibliothèques et frameworks
    Réponses: 5
    Dernier message: 08/11/2004, 14h42

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo