Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Problema Thumbnails

  1. #1

    Problema Thumbnails

    Ho modificato uno script per generare delle thumbnails, tutto funziona ma la qualità delle immagini (essendo che il mio host non supporta le gd) è decisamente pessima.
    Come posso risolvere questo problema?
    Lo script è questo:
    Codice PHP:
    if ($noprev == "0") {
    if (
    $tipodifile == "image/pjpeg") {
      list(
    $ww$hh) = getimagesize($HTTP_POST_FILES['upload']['tmp_name']);
      
    $zz $ww/170;
      
    $new_width=170;     
      
    $new_height $hh/$zz;
      
    $compression=99;    
      
    $source_path="/web/htdocs/www.sito.com/home/files/";    
      
    $destination_path="/web/htdocs/www.sito.com/home/miniature/";
          global 
    $source_path;
          global 
    $destination_path;
          global 
    $new_width;
          global 
    $new_height;
          
    $destimg=ImageCreate($new_width,$new_height) or die("Problemi nelle creazioni dell'immagine");
          
    $srcimg=ImageCreateFromJPEG($source_path.$image_part) or die("Problemi nell'aprire l'immagine");
          
    ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problemi nel ridimensionamento");
          
    ImageJPEG($destimg,$destination_path.$image_part,99) or die("Problemi nel salvataggio");
          }
      if (
    $tipodifile == "image/jpeg") {
      list(
    $ww$hh) = getimagesize($HTTP_POST_FILES['upload']['tmp_name']);
      
    $zz $ww/170
      
    $new_width=170;      
      
    $new_height $hh/$zz;
      
    $compression=99;      
      
    $source_path="/web/htdocs/www.sito.com/home/files/";      
      
    $destination_path="/web/htdocs/www.sito.com/home/miniature/";       
          global 
    $source_path;
          global 
    $destination_path;
          global 
    $new_width;
          global 
    $new_height;
          
    $destimg=ImageCreate($new_width,$new_height) or die("Problemi nelle creazioni dell'immagine");
          
    $srcimg=ImageCreateFromJPEG($source_path.$image_part) or die("Problemi nell'aprire l'immagine");
          
    ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problemi nel ridimensionamento");
          
    ImageJPEG($destimg,$destination_path.$image_part,99) or die("Problemi nel salvataggio");
          }
      if (
    $tipodifile == "image/gif") {
      list(
    $ww$hh) = getimagesize($HTTP_POST_FILES['upload']['tmp_name']);
      
    $zz $ww/170
      
    $new_width=170;     
      
    $new_height $hh/$zz;
      
    $compression=99;    
      
    $source_path="/web/htdocs/www.sito.com/home/files/";     
      
    $destination_path="/web/htdocs/www.sito.com/home/miniature/";        
          global 
    $source_path;
          global 
    $destination_path;
          global 
    $new_width;
          global 
    $new_height;
          
    $destimg=ImageCreate($new_width,$new_height) or die("Problemi nelle creazioni dell'immagine");
          
    $srcimg=ImageCreateFromGIF($source_path.$image_part) or die("Problemi nell'aprire l'immagine");
          
    ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problemi nel ridimensionamento");
          
    ImageGIF($destimg,$destination_path.$image_part,99) or die("Problemi nel salvataggio");
          } 

  2. #2
    Moderatore di Server Apache L'avatar di marketto
    Registrato dal
    Sep 2001
    Messaggi
    5,858
    think simple think ringo

  3. #3

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.