Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

bruno-d2

Como gerar thumbs de Jpg sem componentes

Recommended Posts

Salve galera !!!Alguém sabe uma forma de gerar miniaturas de imagens JPEG usando somente ASP comun ( Não asp.net ) e sem a utilização de componentes ¿!?Qualquer ajuda vale galera!Até msm saber como redimencionar um arquivo JPEG ou GIF já é tudo pra min !!!!!!!!MMUUIITTOO Obrigado pela atenção!Qualquer ajuda hem! ;)

Compartilhar este post


Link para o post
Compartilhar em outros sites

Também já tive esse problema e a solução mesmo é trabalhar com um componente.

 

Informa-te no teu servidor qual o componente que ele utiliza e depois instala no teu pc.

 

No entanto testei 2, e recomendo o aspjpeg, aspimage.

 

Alguma duvida diz.

 

Carlos

Compartilhar este post


Link para o post
Compartilhar em outros sites

flw galera!!!! :D

 

Acabei montando um código em ASP.NET msm!

 

vlw!

 

BOM

 

c alguém buscar no forum e quizer o código...

ta na mão... peguei um parecido com esse e mexi até ficar do geito que eu queria.... assm:

 

<%@ Page Language="VB" Debug="True" %><%@ import namespace="system.drawing" %><%@ import namespace="system.drawing.imaging" %><%@ import namespace="system.drawing.drawing2d" %><%@ import namespace="system.io" %><script runat="server">' ---------------------------------------------------------------------------- '' Sub rotina para o redimencionamento de uma imagem JPEGPublic Sub resizeImg ( strPath As String, strNewPath As String, intMaxW As Integer, intMaxH As Integer )	if System.IO.File.Exists( strPath ) Then		Dim i As System.Drawing.Image		Dim w As Integer		Dim h As Integer		Dim newW As Integer		Dim newH As Integer		'		i = System.Drawing.Image.FromFile( strPath )		w = i.width		h = i.height		' -------------------------------------------------------------------- '		' Define a nova proporção de tamanho		if w > intMaxW or h > intMaxH Then			Dim intPercent As Integer			if w > intMaxW Then				newW		= intMaxW				intPercent	= 100 - ( ( 100 / w ) * ( w - intMaxW ) )				newH		= ( intPercent / 100 ) * h				w			= newW				h			= newH			End if			if h > intMaxH Then				newH		= intMaxH				intPercent	= 100 - ( ( 100 / h ) * ( h - intMaxH ) )				newW		= ( intPercent / 100 ) * w			End if			' ---------------------------------------------------------------- '			' Salva o arquivo com o novo tamanho			Dim objArqNovo As new Bitmap( i, new Size( newW, newH ) )			i.dispose()			objArqNovo.Save( strNewPath, imageformat.jpeg )			objArqNovo.dispose()		End if		' -------------------------------------------------------------------- '		i.dispose()	End IfEnd Sub' ---------------------------------------------------------------------------- ''</script><%Dim strCodigo As String' ---------------------------------------------------------------------------- '' RequeststrCodigo = Trim( Request( "c" ) )' ---------------------------------------------------------------------------- 'if isNumeric( strCodigo ) Then	Dim strFileName	As String	strFileName = Server.MapPath("fotos/") & strCodigo & ".jpg"	' ------------------------------------------------------------------------ '	' Redimenciona a imagem principal	Call resizeImg( strFileName, Server.MapPath( "fotos/" & strCodigo & ".jpg" ), 334, 242 )	' ------------------------------------------------------------------------ '	' Redimenciona a imagem pequena ( _p )	Dim intMin As Integer	Dim intMax As Integer	Dim intNew As Integer	intMin = 90	intMax = 190	Randomize	intNew = CInt( Rnd * ( intMax - intMin ) ) + intMin	Call resizeImg( strFileName, Server.MapPath( "fotos/" & strCodigo & "_p.jpg" ), intNew, intNew )End If' ---------------------------------------------------------------------------- '%>

FUI

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.