ciao a tutti....da un pò utilizzo uno script fatto grazie agli amici del forum per il ridimensionamento delle immagini ed in particolare con l'altezza dell'immagine ridimensionata in proporzione alla larghezza che viene impostata in questa maniera:
height = Convert.ToInt32(width / bmp.Width * bmp.Height)
ora mi dà un errore se l'immagine da ridimensionare è + grande di 1 mb e la spiegazione del provider è:
l''errore è riferito alla variabile che utilizzate (la Convert.ToInt32) che ha una valore massimo di 65538; se nella funzione restituisce un valore maggiore di 65538 si ha l''errore. Di seguito le riporto il debig:
Out of memory.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.OutOfMemoryException: Out of memory.
Source Error:
Line 24: '' Funzione di redim
Line 25: Public Sub ImgRedim(immagine as String, width as Integer, height as Integer)
Line 26: Dim bmp as System.Drawing.Bitmap = CType(System.Drawing.Image.FromFile(immagine), System.Drawing.Bitmap)
Line 27: if height = 0 Then
Line 28: height = Convert.ToInt32(width / bmp.Width * bmp.Height)
Source File: ridimensiona.aspx Line: 26
Stack Trace:
[OutOfMemoryException: Out of memory.]
System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement) +263
System.Drawing.Image.FromFile(String filename) +7
ASP.ridimensiona_aspx.ImgRedim(String immagine, Int32 width, Int32 height) in ridimensiona.aspx:26
ASP.ridimensiona_aspx.Page_Load() in ridimensiona.aspx:20
System.Web.Util.ArglessEventHandlerDelegateProxy.C allback(Object sender, EventArgs e) +10
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
il problema è che su altri siti ospitati dallo stesso provider questo non accade e e tutto funziona benissimo......
commenti/idee??![]()

Rispondi quotando
Perciò ne deduco che il problema tuo sia diverso :master:
