Compressão de imagem -
http://forum.imasters.com.br/public/style_emoticons/default/natal_biggrin.gif pra todos
To com um probleminha:
Uma página de meu site é de novidades que tem uma página de actualização onde faço o upload de uma foto. Esta foto vai com a dimensão e qualidade original. Mas na página novidades eu queria que essa foto aparecesse pequena em qualidade e dimensão. No dreamweaver basta colocar um valor para o "Widht" e a imagem é reduzida automáticamente, mas não sei como fazer a compreessão do seu tamanho.
Já vi várias matérias sobre isso mas não consigo entender
Tá aqui o meu código, se alguém poder ajudar agradeço:
<?php require_once('../Connections/canil.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_canil, $canil);
$query_novidades = "SELECT * FROM novidades";
$novidades = mysql_query($query_novidades, $canil) or die(mysql_error());
$row_novidades = mysql_fetch_assoc($novidades);
$totalRows_novidades = mysql_num_rows($novidades);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="../css.css" rel="stylesheet" type="text/css" />
<STYLE type="text/css">
<!--
BODY,HTML {
scrollbar-face-color: #FFFFFF;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #FFFFFF;
scrollbar-arrow-color: #B42910;
scrollbar-track-color: #FFFFFF;
scrollbar-3dlight-color: #404040;
}
-->
body {
margin-top: 0px;
}
a:link {
color: #666666;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #666666;
}
a:hover {
text-decoration: underline;
color: #FF6600;
}
a:active {
text-decoration: none;
color: #666666;
}
-->
</style></head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="27%" valign="top"><div align="center">
<p><br />
<br />
</p>
</div></td>
<td width="73%" height="50"><div align="left"><img src="../imagens/novidades.gif" width="450" height="30" /></div></td>
</tr>
<?php do { ?>
<tr>
<td width="27%" rowspan="3" valign="top"><img src="<?php echo $row_novidades['foto']; ?>" width="160" "texto"></td>
<td background="../imagens/fundo_texto.gif"><p align="justify" class="texto"><a href="../novidades_detalhe.php?recordID=<?php echo $row_novidades['id']; ?>"><strong><img src="../imagens/marca.gif" width="10" height="10" border="0" /></strong></a>
<a href="novidades_detalhe.php?recordID=<?php echo $row_novidades['id']; ?>"><strong><?php echo $row_novidades['titulo']; ?></strong></a>
<p align="justify" class="texto"><?php echo $row_novidades['texto']; ?>
<p align="justify" class="texto"><span class="data"><?php echo $row_novidades['data']; ?></span>
<strong><br>
</strong>
<p align="justify" class="texto"> </p>
<p align="justify" class="data"> </p></td>
</tr>
<tr>
<td background="../imagens/fundo_texto.gif"><div align="right" class="data">[<a href="novidades_detalhe.php?recordID=<?php echo $row_novidades['id']; ?>">ver+</a>]</div></td>
</tr>
<tr>
<td valign="bottom" background="../imagens/fundo_texto.gif"> </td>
</tr>
<tr>
<td colspan="2" valign="top" class="texto"> </td>
</tr>
<?php } while ($row_novidades = mysql_fetch_assoc($novidades)); ?>
<tr>
<td valign="top"> </td>
<td background="../imagens/fundo_texto.gif"> </td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($novidades);
?>Discussão (2)
Carregando comentários...