Page 1 of 1

Displaying a thumbnail does not work (ASP)

Posted: Wed Sep 07, 2005 6:50 pm
by Billy
Hi to everybody, my name is billy and i want to ask u something... I'm an asp person and recently i installed this component to work with asp, but unfortunelly, i couldn't find in the help area an example with vbscript (for asp) and it's making me nervious... can somebody help me giving me an example how to do a simple thumbnail from an image?? thanks and let me know, i found this, but it shows an error where is SERVER MAPPATH, it says that i'm selecting an invalid type of image... thanks for your help, masters!

Code: Select all

<%
Dim Image 
Set Image = Server.CreateObject("GflAx" & gflsdk_version & ".GflAx") 
						
Image.LoadBitmap server.mappath("/images_gallery/encabezado2.gif") 
						
iwidth = image.width 
iheight = image.height 
						
= iheight/iwidth 
						
if (image.width > int(request("width"))) then 
newwidth = request("width") 
newheight = request("width") * aspect 
Image.Resize newwidth, newheight 
end if 
						
						Image.SaveFormat = 1 ' This is a JPEG 
						Image.SaveJPEGQuality = 95 
						Response.ContentType = "image/" & ctype 
						Response.Expires = 60 
						Response.BinaryWrite Image.SendBinary 
						
Set Image = nothing
%>

Posted: Thu Sep 08, 2005 7:43 am
by Ithier
I don't know your about server.mappath problem, but as you are reading a gif file you must enable LZW compression before reading the file (because there is a patent from UNISYS on LZW, so it is not activated by default):

Image.EnableLZW = TRUE

Posted: Sun Sep 18, 2005 1:58 pm
by xnview
Ithier wrote:I don't know your about server.mappath problem, but as you are reading a gif file you must enable LZW compression before reading the file (because there is a patent from UNISYS on LZW, so it is not activated by default):

Image.EnableLZW = TRUE
Yes, i'll remove soon EnableLZW because the patent doesn't exists anymore...