aspjpeg optimization

Ryders512

Guppy
I have a script that I use but I wanted to know if anyone else uses a better script for smaller file sizes but still maintain a pure image?
This script takes the image and creates a thumbnail and optimizes the original image.

Here is my script

jpeg.Open Server.MapPath(SavePath)
originalW = jpeg.OriginalWidth
originalH = jpeg.OriginalHeight
L = 100
jpeg.PreserveAspectRatio = True
If jpeg.OriginalWidth > jpeg.OriginalHeight Then
jpeg.Width = L
Else
jpeg.Height = L
End If

jpeg.Sharpen 1, 250
'Draw frame: black, 2-pixel width
jpeg.Canvas.Pen.Color = &H000000
jpeg.Canvas.Pen.Width = 1
jpeg.Canvas.Brush.Solid = False
jpeg.Canvas.Bar 0, 0, jpeg.Width, jpeg.Height
adjustW = jpeg.Width
adjustH = jpeg.Height
If UCase(Right(strName, 3)) <> "JPG" Then
strName = strName & ".jpg"
End If
thumbName = "thumb" + strName
SavePath = thumbSavePath & thumbName
jpeg.Save Server.MapPath(SavePath)
jpeg.Close
SavePath = originalSavePath & strName
jpeg.Open Server.MapPath(SavePath)
L = 500
jpeg.PreserveAspectRatio = True
If jpeg.OriginalWidth > jpeg.OriginalHeight Then
jpeg.Width = L
Else
jpeg.Height = L
End If

jpeg.Sharpen 1, 250
'Draw Text
jpeg.Canvas.Font.Color = &H000000
jpeg.Canvas.Font.Family = "Verdana"
'jpeg.Canvas.Font.Bold = True
jpeg.Canvas.Font.Quality = 0
jpeg.Canvas.Font.BKColor = &HCCCCCC
jpeg.Canvas.Font.BKMode = "Opaque"
jpeg.Canvas.Font.Size = 10
jpeg.Canvas.Font.Rotation = 270
jpeg.Canvas.PrintText jpeg.Width, jpeg.Height-80, "(512RYDERS.COM)"
'Draw frame: black, 2-pixel width
jpeg.Canvas.Pen.Color = &H000000
jpeg.Canvas.Pen.Width = 1
jpeg.Canvas.Brush.Solid = False
jpeg.Canvas.DrawBar 0, 0, jpeg.Width, jpeg.Height
SavePath = originalSavePath & strName
jpeg.Save Server.MapPath(SavePath)
jpeg.Close
 
Ryders512 said:
I have a script that I use but I wanted to know if anyone else uses a better script for smaller file sizes but still maintain a pure image?
This script takes the image and creates a thumbnail and optimizes the original image.
You can look into the .quality method that allows you to change the quality of the JPG image. With something smaller than 100x100 I find I can drop the quality down to at least 60 or 70 without a real noticable difference. This can reduce the size of your thumbnails and reduce your bandwidth usage.
 
Back
Top