Displaying a thumbnail does not work (ASP)

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

Billy

Displaying a thumbnail does not work (ASP)

Post 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
%>
User avatar
Ithier
Posts: 47
Joined: Fri Nov 19, 2004 10:50 am
Location: Paris, France

Post 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
User avatar
xnview
Author of XnView
Posts: 43163
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post 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...
Pierre.