Jump to content


Marcus Vinícius Nash

Member Since 03/02/2009
Offline Last Active 07/04/2011, 22:51
-----

Posts I've Made

In Topic: Script De Paginação De Fotos Sem Refresh

27/02/2009, 09:34

queria saber como diminuir o tamanho das imagens.
tem como?


Olha, você pode redefinir a largura e a altura das imagens no width="793" e no height="396". ou então colocar um script por exemplo em PHP com GD.



class GD2 {

		var $bgcolor_red = 255;
		var $bgcolor_green = 255;
		var $bgcolor_blue = 255;
		var $quality=100;

 function MaxSizeThumbnail($file,$size,$savefile='') {


						if($this->IfSupportedImageTypes($file)) {
										list($width, $height) = getimagesize($file);


										if($width > $height) {
												$size_percent = (int)($size / ($width / 100));
												$new_height = (int) ($size_percent * ($height/100));
												$new_width  = $size;
												$y = ($size - $new_height) / 2;
												$x = 0;
												//echo $x;
										} else {
												$size_percent = (int)($size / ($height / 100));
												$new_width = (int) ($size_percent * ($width/100));
												$new_height  = $size;
												$x = ($size - $new_width) / 2;
												$y = 0;
										}


										if($savefile != '') {
												$this->CreateImageX($file,$this->ResizeImage($file,$new_width,$new_height,$x,$y),'',$savefile);
										} else {
												$this->CreateImageX($file,$this->ResizeImage($file,$new_width,$new_height,$x,$y));
										}

						} else {
								$this->CreateErrorImage("Unsupported Image File");
						}
}
$gd = new GD2;

if($_GET['foto']){
   if(!$_GET['size']){ $size = 130; } else { $size = $_GET['size']; }
   $gd->MaxSizeThumbnail($_GET['foto'],$size);
}

Coloque dentro de um arquivo chamado por exemplo: gd.php e coloque o endereço da imagem como gd.php?foto=local/arquivo.jpg

IPB Skin By Virteq