Nej. Har aldrig varit med om detta.
' ## CONVERT FILE TO WEBFORMAT
' 1. fileName = original file = 800
' 2. high_fileName = 500
' 3. low_fileName = 120
' ## [url]http://www.aspjpeg.com/manual.html[/url]
' ## RESAMPLE IMG
Dim Jpeg
DIM intNewWidth, intNewHeight
Set Jpeg = Server.CreateObject("Persits.Jpeg")
Path = Server.MapPath("/images/" & myFileName )
Jpeg.Open Path
' ## SAVE FILE TO DISK - 800
IF Jpeg.OriginalWidth > 800 THEN
intNewWidth = 800
IF Jpeg.OriginalWidth > CInt(intNewWidth) THEN
Jpeg.PreserveAspectRatio = True
Jpeg.Width = intNewWidth
END IF
END IF
Jpeg.Save Server.MapPath("/images/" & myFileName )
' ## SAVE FILE TO DISK - 500
IF Jpeg.OriginalWidth > 500 THEN
intNewWidth = 500
IF Jpeg.OriginalWidth > CInt(intNewWidth) THEN
Jpeg.PreserveAspectRatio = True
Jpeg.Width = intNewWidth
END IF
END IF
Jpeg.Save Server.MapPath("/images/high_" & myFileName )
' ## SAVE FILE TO DISK - 120
IF Jpeg.OriginalWidth > 120 THEN
intNewWidth = 140
IF Jpeg.OriginalWidth > CInt(intNewWidth) THEN
Jpeg.PreserveAspectRatio = True
Jpeg.Width = intNewWidth
END IF
' ## ADD BLACK BORDER
' Jpeg.Canvas.Pen.Color = &H000000 ' Black
' Jpeg.Canvas.Pen.Width = 2
' Jpeg.Canvas.Brush.Solid = False ' or a solid bar would be drawn
' Jpeg.Canvas.DrawBar 1, 1, Jpeg.Width, Jpeg.Height
END IF
Jpeg.Save Server.MapPath("/images/low_" & myFileName )
' ## SAVE FILE TO DISK - 50
IF Jpeg.OriginalHeight > 50 THEN
intNewHeight = 50
IF Jpeg.OriginalHeight > CInt(intNewHeight) THEN
Jpeg.PreserveAspectRatio = True
Jpeg.Height = intNewHeight
END IF
END IF
Jpeg.Save Server.MapPath("/images/thumb_" & myFileName )
END IF
