Visualizzazione dei risultati da 1 a 2 su 2

Discussione: ridimensionare gif

  1. #1

    ridimensionare gif

    Ciao solitamente io ridimensionavo le img jpg così

    $name="ciao.jpg"
    $img = imagecreatefromjpeg($name);
    $img_width = imagesx($img);
    $img_height = imagesy($img);
    $thumb_width = 90;
    $thumb_height = ($img_width != $thumb_width) ? floor($thumb_width * $img_height / $img_width) : $img_height;
    $thumb = imagecreatetruecolor($thumb_width, $thumb_height);
    imagecopyresized($thumb, $img, 0, 0, 0, 0, $thumb_width, $thumb_height, $img_width, $img_height);
    imagejpeg($thumb, "small/ciao.jpg", 72);
    imagedestroy($img);
    imagedestroy($thumb);

    Ma ora ho necessità di ridimensionare anche le img gif ho trovato
    imagecreatefromgif
    ma come puo essere implementato nel mio script ovvero che ridimensioni sia gif che jpg?

  2. #2
    Utente di HTML.it L'avatar di gianiaz
    Registrato dal
    May 2001
    Messaggi
    8,027
    puoi controllare l'estensione e richiamare le funzioni adeguate, ma prima di tutto occhio a questa nota:

    Nota: Since all GIF support was removed from the GD library in version 1.6, this function is not available if you are using that version of the GD library. Support is expected to return in a version subsequent to the rerelease of GIF support in the GD library in mid 2004. For more information, see the GD Project site.

    ciao

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.