Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 16

Discussione: imagesx() imagesy()

  1. #1

    imagesx() imagesy()

    allora...queste due sono le funzioni...
    Codice PHP:
    <?php
    // create a 300*200 image
    $img imagecreate(300200);

    echo 
    imagesx($img); // 300
    echo imagesy($img); // 200
    ?>
    ...ma se io invece voglio prendere le grandezze dell'immagine pippo.jpg posso anche non crearla l'immagine con imagecreate?E scrivere direttamente:
    Codice PHP:
    $img "pippo.jpg";
    echo 
    imagesx($img);
    echo 
    imagesy($img); 
    così sarebbe giusto?
    Il mio sito: CIONCO.ALTERVISTA.ORG
    Lloyd Bank$
    I roll with the gangstas don't get fly with your mouth
    The wrong punchline'll have niggas inside of your house

  2. #2
    getimagesize -- Get the size of an image
    Description
    array getimagesize ( string filename [, array imageinfo])


    The getimagesize() function will determine the size of any GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2, JPX, JB2, JPC, XBM, or WBMP image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag.

    Returns an array with 4 elements. Index 0 contains the width of the image in pixels. Index 1 contains the height. Index 2 is a flag indicating the type of the image: 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM. These values correspond to the IMAGETYPE constants that were added in PHP 4.3. Index 3 is a text string with the correct height="yyy" width="xxx" string that can be used directly in an IMG tag.

  3. #3
    si vabbè...quella roba l'avevo già letta da php.net...ma la mia domanda non trova risposta in quelle righe che hai postato...
    Il mio sito: CIONCO.ALTERVISTA.ORG
    Lloyd Bank$
    I roll with the gangstas don't get fly with your mouth
    The wrong punchline'll have niggas inside of your house

  4. #4
    ho provato ad usare imagesx e mi ha dato questo errore:
    Call to undefined function: imagesx()
    mi sta prendendo per il c**o?!
    Il mio sito: CIONCO.ALTERVISTA.ORG
    Lloyd Bank$
    I roll with the gangstas don't get fly with your mouth
    The wrong punchline'll have niggas inside of your house

  5. #5
    perchè da questo errore?
    su php.net non diceva di nessuna installazione della funzione...quindi dovrebbe funzionare...
    Il mio sito: CIONCO.ALTERVISTA.ORG
    Lloyd Bank$
    I roll with the gangstas don't get fly with your mouth
    The wrong punchline'll have niggas inside of your house

  6. #6
    Utente bannato
    Registrato dal
    Apr 2003
    Messaggi
    1,119
    ma prima non l'hai usato?
    non capisco il tuo problema...

  7. #7
    no,non l'avevo usato...allora, io devo prendere la grandezza di una immagine, solo che quando scrivo il codice per farlo (postato sopra) mi da l'errore (postato anche questo) eppure la funzione è così:
    int imagesx ( resource image)
    non è che magari devo mettere int?
    Il mio sito: CIONCO.ALTERVISTA.ORG
    Lloyd Bank$
    I roll with the gangstas don't get fly with your mouth
    The wrong punchline'll have niggas inside of your house

  8. #8

    e se tu provassi con...

    Codice PHP:

    $nomeFile 
    "mio.php";
    if (
    file_exists($nomeFile))             

    $fp fopen ($nomeFile,  "r"); 
    Prova a chiedere al sistema se il file esiste e quindi aprilo. Poi gli chiedi le dimensioni.
    "La grandezza dell'uomo si misura in base a quel che cerca e all'insistenza con cui egli resta alla ricerca".

  9. #9
    il problema sta nel fatto che non mi riconosce la funzione imagesx, mi da questo errore
    Call to undefined function: imagesx()
    sto cercando di fare un semplicissimo
    Codice PHP:
    <?php

    $img 
    "001.jpg";
    echo 
    imagesx($img);
    echo 
    imagesy($img);

    ?>
    e non mi funziona per quel problema...
    Il mio sito: CIONCO.ALTERVISTA.ORG
    Lloyd Bank$
    I roll with the gangstas don't get fly with your mouth
    The wrong punchline'll have niggas inside of your house

  10. #10
    ora ho provato così
    Codice PHP:
    <?php
    $img 
    "001.jpg";
    $wight imagesx($img);

    echo 
    "l'immagine è larga $wight pixels";

    ?>
    ma è inutile...da sempre lo stesso errore...eppure la sintassi dovrebbe essere corretta...
    Il mio sito: CIONCO.ALTERVISTA.ORG
    Lloyd Bank$
    I roll with the gangstas don't get fly with your mouth
    The wrong punchline'll have niggas inside of your house

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.