Carissimi,
girovagando sul web alla ricerca di un crop resize di immagine on the fly ho trovato questo interessantissimo script nonchè adatto al mio scopo, solo che ho riscontrato un problema che ho segnalato ad aruba (provider su cui ho il mio sito) che l'utilizzo dello stesso blocca l'immagine e la tiene bloccata , infatti se provo ad eliminarla dal server tramite script oppure attraverso un client ftp non me la fa eliminare PERMISSION DENIED etc.
Aruba gentilmente ha fatto i suoi controlli e mi hanno comunicato che era un problema lato client, qualche script che blocca l'immagine, e dopo vari test che ho fatto sono giunto a capire che è proprio questo square.aspx, ora vorrei utilizzarlo, si potrebbe fare qualche modifica sullo script (cosa che non saprei fare) oppure potete consigliarmi qualche altri script che abbia le stesse funzionalità?
Graziecodice:<%@ 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 i = System.Drawing.Image.FromFile(strFilename) b = New system.drawing.bitmap(request.QueryString("opx"), request.QueryString("opx"), pixelformat.format24bpprgb) g = graphics.fromimage(b) g.InterpolationMode = 2 g.SmoothingMode = 4 g.PixelOffsetMode = 4 g.CompositingQuality = 4 ’ scale and translate the image Dim NewLar, NewAlt, SrcX, SrcY 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() %>
G.

Rispondi quotando