<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problema Script Thumb]]></title><description><![CDATA[<p dir="auto">Buonasera, avrei questo problema.</p>
<p dir="auto">Dato questo script</p>
<pre><code>&lt;?php   

   function thumb($path,$foto,$user){
   
   $s_thumbnail = "";
   $nome_immagine = "./".$path;
   $max_alt = 140;
   $max_lar = 120;

   if(!file_exists($nome_immagine))
      $s_thumbnail = "&lt;h3&gt;Nessuna immagine!&lt;/h3&gt;";
   else {
      $info_immagine = getimagesize($nome_immagine);

      switch($info_immagine[2]) {
         case 1:
            //GIF
            $thumbnail = @imagecreatefromgif($nome_immagine);
            break;
         case 2:
            //JPG
            $thumbnail = @imagecreatefromjpeg($nome_immagine);
            break;
         case 3:
            //PNG
            $thumbnail = @imagecreatefrompng($nome_immagine);
            break;
         default:
            //ALTRO
            $s_thumbnail = "&lt;h3&gt;Nessuna immagine!&lt;/h3&gt;";
            break;
      }
   }

   if($thumbnail) {
      $lar = imagesx($thumbnail);
      $alt = imagesy($thumbnail);
      $scala = min($max_lar / $lar, $max_alt / $alt);

      if($scala &lt; 1) {
         $new_lar = floor($scala*$lar);
         $new_alt = floor($scala*$alt);

         $tmp_thumbnail = imagecreatetruecolor($new_lar, $new_alt);
         imagecopyresized($tmp_thumbnail, $thumbnail, 0, 0, 0, 0, $new_lar, $new_alt, $lar, $alt);
         
         $thumbnail = $tmp_thumbnail;
      }
   
		$nomeimage = "th_".$foto ;
		#creazione preview con GD library
		$new_width=120;      //Larghezza immagine ridimensionata
		$new_height=90;      //Altezza immagine ridimensionata
		
		$destination_path="./photo/$user/thumb/";      //diretory dove vogliamo salvare l'immagine di preview
		
		if (!file_exists($destination_path.$nomeimage)) {
		ImageJPEG($thumbnail,$destination_path.$nomeimage) or die("Problemi nel salvataggio");
		
		return TRUE;
		
		}
   } else
      echo $s_thumbnail;
	  
	  }
	  
	  ?&gt;
</code></pre>
<p dir="auto">Non mi fa i thumb di foto con risoluzione maggiore a 1024 x 768 o giù di lì.</p>
<p dir="auto">Come mai?</p>
]]></description><link>https://dev.connect.gt/topic/26269/problema-script-thumb</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Dec 2026 08:44:04 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/26269.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 24 Jan 2007 00:57:20 GMT</pubDate><ttl>60</ttl></channel></rss>