Hamlets Posted December 18, 2006 Report Share Posted December 18, 2006 (edited) $neww=40; $newh=40; list(, , $type,)=@getimagesize($file); if ($type==1) {$funci="imagecreatefromgif";} //$funco="imagegif";} if ($type==2) {$funci="imagecreatefromjpeg";} //$funco="imagejpeg";} $im1 = @$funci($file); $im2=@ImageCreate($neww,$newh); @imagecopyresized($im2, $im1, 0,0,0,0,$neww,$newh, @imagesx($im1), @imagesy($im1)); @header("Content-type: image/png"); @imagepng($im2); Ir šāds bildes samazināšanas kods, bet pēc tā bildes svars tik un tā ir pārāk liels. Ar kādu kodu varētu papildināt šo, lai arī pasliktinātu bildes kvalitāti? Edited December 18, 2006 by Hamlets Link to comment Share on other sites More sharing options...
andrisp Posted December 18, 2006 Report Share Posted December 18, 2006 Domāju, ka tad tev vajadzēs izvadīt gif vai jpg bildes, nevis png. Link to comment Share on other sites More sharing options...
rpr Posted December 18, 2006 Report Share Posted December 18, 2006 aa, jpg var mainiit kvalitaati ar parametru. uzliec kaadus 80 un buus ok. Link to comment Share on other sites More sharing options...
Delfins Posted December 18, 2006 Report Share Posted December 18, 2006 Protams neatkrīt variants gd->jpeg->png :) Link to comment Share on other sites More sharing options...
bubu Posted December 18, 2006 Report Share Posted December 18, 2006 Nedomāju, ka tas uzlabos faila izmēru. Manuprāt tieši otrādi - palielinās. Jo png kompresija nav labi piemērojam jpeg radītajiem defektiem. Link to comment Share on other sites More sharing options...
Recommended Posts