RISOLTO: imagejpeg quality 0 to 100<br>imagepng quality 0 to 9 dove 0 è il max, <div><br></div><div><br></div><div><br></div><div> che strano</div><div><br></div><div><br></div><div>tanga</div><div><div class="gmail_quote">
2011/7/17 bartrosso <span dir="ltr">&lt;<a href="mailto:bartrosso@gmail.com">bartrosso@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">domanda semplice semplice,<br>
<div>cosa devo fare per far funzionare imagepng??? funziona perfettamente imagejpeg,,,</div><div><br></div><div><div><span style="white-space:pre-wrap">        </span><span style="background-color:rgb(102, 255, 255)"> function makethumb($name,$thname,$height){</span></div>

<div><span style="background-color:rgb(102, 255, 255)"><span style="white-space:pre-wrap">        </span> <span style="white-space:pre-wrap">        </span>$data = GetImageSize($name);</span></div>
<div><span style="background-color:rgb(102, 255, 255)"><span style="white-space:pre-wrap">        </span> <span style="white-space:pre-wrap">        </span>switch($data[2]) {</span></div>
<div><span style="background-color:rgb(102, 255, 255)"><span style="white-space:pre-wrap">        </span> <span style="white-space:pre-wrap">                </span>case 1: copy($name,$thname);</span></div>
<div><span style="background-color:rgb(102, 255, 255)"><span style="white-space:pre-wrap">        </span> <span style="white-space:pre-wrap">                </span>return;</span></div>
<div><span style="background-color:rgb(102, 255, 255)"><span style="white-space:pre-wrap">        </span> <span style="white-space:pre-wrap">                </span>break;</span></div>
<div><span style="background-color:rgb(102, 255, 255)"><span style="white-space:pre-wrap">        </span> <span style="white-space:pre-wrap">                </span>case 2 :</span></div>
<div><span style="background-color:rgb(102, 255, 255)"><span style="white-space:pre-wrap">        </span> <span style="white-space:pre-wrap">                </span>$im = imagecreatefromjpeg($name);</span></div>
<div><span style="background-color:rgb(102, 255, 255)">                           </span></div><div><span style="background-color:rgb(102, 255, 255)">break;</span></div>
<div><span style="background-color:rgb(102, 255, 255)">case 3:</span></div><div><span style="background-color:rgb(102, 255, 255)">$im = imagecreatefrompng($name);</span></div>
<div><span style="background-color:rgb(102, 255, 255)"><br></span></div><div><span style="background-color:rgb(102, 255, 255)">break;</span></div><div><span style="background-color:rgb(102, 255, 255)"><br>
</span></div><div><span style="background-color:rgb(102, 255, 255)"><span style="white-space:pre-wrap">        </span> <span style="white-space:pre-wrap">        </span>}</span></div>
<div><span style="background-color:rgb(102, 255, 255)"><span style="white-space:pre-wrap">        </span> <span style="white-space:pre-wrap">        </span></span></div><div>
<span style="background-color:rgb(102, 255, 255)">$w=ImageSX($im);</span></div><div><span style="background-color:rgb(102, 255, 255)">$h=ImageSY($im);<span style="white-space:pre-wrap">        </span></span></div>
<div><span style="background-color:rgb(102, 255, 255)">$div=$h/$heigth;</span></div><div><span style="background-color:rgb(102, 255, 255)">$nw=$w/$div;</span></div><div>
<span style="background-color:rgb(102, 255, 255)"><br></span></div><div><span style="background-color:rgb(102, 255, 255)">$newimg=ImageCreatetruecolor($nw,$height);</span></div>
<div><span style="background-color:rgb(102, 255, 255)"><br></span></div><div><span style="background-color:rgb(102, 255, 255)">ImageCopyResized($newimg,$im,0,0,0,0,$nw,$heigth,$w,$h);</span></div>
<div><span style="background-color:rgb(102, 255, 255)">if($data[2]==2) Imagejpeg($newimg,$thname,100);</span></div><div><span style="background-color:rgb(102, 255, 255)">if($data[2]==3) Imagepng($newimg);</span></div>
<div><span style="background-color:rgb(102, 255, 255)">}</span></div><div><span style="background-color:rgb(102, 255, 255)"><br></span></div><div><span style="background-color:rgb(102, 255, 255)">makethumb($pathbig,$pathsmall,$height);</span></div>

</div><div><span style="background-color:rgb(102, 255, 255)"><br></span></div><div><span style="background-color:rgb(102, 255, 255)"><br></span></div><div><span style="background-color:rgb(102, 255, 255)"><br>
</span></div><div><span style="background-color:rgb(102, 255, 255)"><br></span></div><div><span style="background-color:rgb(255, 255, 255)">pathbig pathsmall e height sono semplicemente path per sorgente e destinazione, sono le stesse per imagejpeg e funzionano bene con i jpeg...</span></div>

<div><span style="background-color:rgb(255, 255, 255)"><br></span></div><div><span style="background-color:rgb(255, 255, 255)"><br></span></div><div><span style="background-color:rgb(255, 255, 255)">tanga</span></div>
<div><span style="background-color:rgb(255, 255, 255)"><br></span></div><div><span style="background-color:rgb(255, 255, 255)"><br></span></div><div><span style="background-color:rgb(255, 255, 255)">chi può mi faccia un fischio</span></div>

<div><span style="background-color:rgb(255, 255, 255)"><br></span></div><div><span style="background-color:rgb(255, 255, 255)"><br></span></div><div><span style="background-color:rgb(255, 255, 255)"><br>
</span></div><div><span style="background-color:rgb(255, 255, 255)"><br></span></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>Sono ciò che sono grazie a quello che siamo tutti,</div>
</blockquote><div><br><br><br>un mio amico mi ha detto che ubuntu significa: &quot;Non so configurare Debian..&quot;<br><br><br>«Immagina se ogni persona sulla terra potesse condividere con accesso libero e totale tutta la conoscenza umana.»<br>

— Jimmy Wales, fondatore di Wikipedia<br><br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>Sono ciò che sono grazie a quello che siamo tutti,<br><br><br><br>un mio amico mi ha detto che ubuntu significa: &quot;Non so configurare Debian..&quot;<br><br><br>«Immagina se ogni persona sulla terra potesse condividere con accesso libero e totale tutta la conoscenza umana.»<br>
— Jimmy Wales, fondatore di Wikipedia<br><br>
</div>