Hej alle,
Jeg er ved at lave en script, som kan lave thumbnails "on-the-fly", og
jeg har fulgt vejledningen på:
http://www.mpa-lifetech.de/Forum/aspObjects/Dynamic%20Image%20Thumbnails%20Using%20ASPImage%20and%20the%20FileSystemObject.htm.
Jeg linker til thumbnail.asp siden med:
<img src="thumbnail.asp?FileName=billed1.jpg&Size=100">
Men thumbnail.asp siden returnere ikke noget billede.
Her er min kode til thumbnail.asp:
<%
If Request("FileName") <> "" Then
Set FileObject = CreateObject("Scripting.FileSystemObject")
If FileObject.FileExists(Request("FileName")) Then
If Request("Size") <> "" Then
Size = Int(Request("Size"))
Else
Size = 50
End If
Response.Expires = 0
Set Image = Server.CreateObject("AspImage.Image")
Response.ContentType = "image/jpeg"
Image.LoadImage (Request("FileName"))
Width = Image.MaxX
Height = Image.MaxY
If Width < Size Then Size = Width
If Width > Height Then
NewWidth = Round(Size/Width,2)
NewHeight = Int(NewWidth*Height)
Image.Resize Size,NewHeight
Else
NewHeight = Round(Size/Height,2)
NewWidth = Int(NewHeight*Width)
Image.Resize NewWidth,Size
End If
Image.CreateButton 5,true
Image.ImageFormat = 1
Image.JPEGQuality = 50
ProgressiveJPEGEncoding = true
Response.BinaryWrite Image.Image
Set Image = nothing
End If
Set FileObject = nothing
End If
%>
Al hjælp modtages med stor taknemlighed!
Mvh
Kenneth