salve,
ho trovato questo utilissimo script che ritaglia l'immagine in un quadrato e me la ridimensiona secondo le mie esigenze.
avrei un questido da porvi: come per il webresize, vorrei sapere come posso gestire la qualità della jpg generata dallo script.
grazie per l'aiuto.

questo è il codice

Codice PHP:
<%@ Page Language="VB"%>
<%@ 
import Namespace="System.Drawing"%>
<%@ 
import Namespace="System.Drawing.Imaging"%>
<%@ 
import Namespace="System.Text.RegularExpressions"%>

<%
dim strFilename as string
dim i 
as System.Drawing.Image
dim b 
as System.Drawing.bitmap
dim g 
as graphics
If Left(request.QueryString("img"),4) = "http" then
    
'Response.Write("case1
")
    strFilename=server.mappath(right(request.QueryString("img"),len(request.QueryString("img"))-len(Request.ServerVariables("SERVER_NAME"))-7))
else
    '
Response.Write("case2
"
)
    
strFilename server.mappath(request.QueryString("img"))
end if
System.Drawing.Image.FromFile(strFilename)
= New system.drawing.bitmap(request.QueryString("opx"), request.QueryString("opx"), pixelformat.format24bpprgb)
graphics.fromimage(b)
g.InterpolationMode 2
g
.SmoothingMode 4
g
.PixelOffsetMode 4
g
.CompositingQuality 4

’ scale 
and translate the image
Dim NewLar
NewAltSrcXSrcY
If i.height>i.width then
    NewLar 
i.width
    NewAlt 
i.width
    SrcX
=0
    SrcY 
= (((i.height*request.QueryString("opx"))/i.width)-request.QueryString("opx"))/2
else
    
NewLar i.height
    NewAlt 
i.height
    SrcY 
0
    SrcX 
= (((i.width*request.QueryString("opx"))/i.height)-request.QueryString("opx"))/2

end 
if
g.drawimage(i,New rectangle(0,0,request.QueryString("opx"),request.QueryString("opx")), New rectangle(SrcX,SrcY,NewLar,NewAlt), GraphicsUnit.Pixel)
'Response.Write(NewLar & " " & NewAlt & " " & SrcX & " " & SrcY)
response.contenttype="image/jpeg"
b.save(response.outputstream, imageformat.jpeg)
b.dispose() 
%>